mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-27 17:30:32 +08:00
Fix tests
This commit is contained in:
parent
4c33abff05
commit
6d41d4d112
1 changed files with 8 additions and 3 deletions
|
@ -103,7 +103,9 @@ describe Experiment, type: :model do
|
|||
expect(Activities::CreateActivityService)
|
||||
.to(receive(:call)
|
||||
.with(hash_including(activity_type: :create_module)))
|
||||
|
||||
expect(Activities::CreateActivityService)
|
||||
.to(receive(:call)
|
||||
.with(hash_including(activity_type: :assign_user_to_module)))
|
||||
function_call
|
||||
end
|
||||
|
||||
|
@ -137,12 +139,15 @@ describe Experiment, type: :model do
|
|||
.to(receive(:call)
|
||||
.with(hash_including(activity_type:
|
||||
:clone_module))).exactly(3).times
|
||||
|
||||
expect(Activities::CreateActivityService)
|
||||
.to(receive(:call)
|
||||
.with(hash_including(activity_type:
|
||||
:assign_user_to_module))).exactly(3).times
|
||||
function_call
|
||||
end
|
||||
|
||||
it 'creats 3 new activities in DB' do
|
||||
expect { function_call }.to change { Activity.all.count }.by(3)
|
||||
expect { function_call }.to change { Activity.all.count }.by(6)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue