From 6d41d4d1129dfd9a1e5608d17d0589199110ff1a Mon Sep 17 00:00:00 2001 From: aignatov-bio Date: Tue, 31 Mar 2020 14:16:31 +0200 Subject: [PATCH] Fix tests --- spec/models/experiment_spec.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/spec/models/experiment_spec.rb b/spec/models/experiment_spec.rb index 602990bbe..4552dcac6 100644 --- a/spec/models/experiment_spec.rb +++ b/spec/models/experiment_spec.rb @@ -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