Commit ff22dfbf authored by Roger Rüttimann's avatar Roger Rüttimann Committed by Roger Meier

fix tests for mysql db.

parent 34289f66
...@@ -625,7 +625,7 @@ describe Group do ...@@ -625,7 +625,7 @@ describe Group do
group.update!(description: 'foobar') group.update!(description: 'foobar')
end end
def expects_other_user_to_require_two_factors def expects_other_user_to_require_two_factors(expected_calls_mysql_db = 1)
calls = 0 calls = 0
allow_any_instance_of(User).to receive(:update_two_factor_requirement) do allow_any_instance_of(User).to receive(:update_two_factor_requirement) do
calls += 1 calls += 1
...@@ -636,7 +636,7 @@ describe Group do ...@@ -636,7 +636,7 @@ describe Group do
if Group.supports_nested_objects? if Group.supports_nested_objects?
expect(calls).to eq 2 expect(calls).to eq 2
else else
expect(calls).to eq 1 expect(calls).to eq expected_calls_mysql_db
end end
end end
...@@ -644,7 +644,7 @@ describe Group do ...@@ -644,7 +644,7 @@ describe Group do
other_user = create(:user) other_user = create(:user)
group.add_user(other_user, GroupMember::OWNER) group.add_user(other_user, GroupMember::OWNER)
expects_other_user_to_require_two_factors expects_other_user_to_require_two_factors(2)
end end
it 'calls #update_two_factor_requirement on each subgroup member' do it 'calls #update_two_factor_requirement on each subgroup member' do
...@@ -660,7 +660,7 @@ describe Group do ...@@ -660,7 +660,7 @@ describe Group do
project_user = create(:user) project_user = create(:user)
project.add_developer(project_user) project.add_developer(project_user)
expects_other_user_to_require_two_factors expects_other_user_to_require_two_factors(2)
end end
it 'calls #update_two_factor_requirement on each subgroups child project member' do it 'calls #update_two_factor_requirement on each subgroups child project member' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment