mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-28 01:36:33 +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)
|
expect(Activities::CreateActivityService)
|
||||||
.to(receive(:call)
|
.to(receive(:call)
|
||||||
.with(hash_including(activity_type: :create_module)))
|
.with(hash_including(activity_type: :create_module)))
|
||||||
|
expect(Activities::CreateActivityService)
|
||||||
|
.to(receive(:call)
|
||||||
|
.with(hash_including(activity_type: :assign_user_to_module)))
|
||||||
function_call
|
function_call
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -137,12 +139,15 @@ describe Experiment, type: :model do
|
||||||
.to(receive(:call)
|
.to(receive(:call)
|
||||||
.with(hash_including(activity_type:
|
.with(hash_including(activity_type:
|
||||||
:clone_module))).exactly(3).times
|
: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
|
function_call
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'creats 3 new activities in DB' do
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue