Commit b03229ac authored by eugielimpin's avatar eugielimpin

Exclude admins from verification experiment when creating groups

parent 86b33eb5
......@@ -62,6 +62,8 @@ module EE
override :require_verification_for_group_creation_enabled?
def require_verification_for_group_creation_enabled?
# Skip the verification for admins and auditors (added mainly for E2E tests)
return false if current_user.can_read_all_resources?
# Experiment should only run when creating top-level groups
return false if params[:parent_id]
......
......@@ -244,6 +244,14 @@ RSpec.describe GroupsHelper do
it { is_expected.to eq(false) }
end
context 'when user is admin or auditor' do
before do
allow(current_user).to receive(:can_read_all_resources?).and_return(true)
end
it { is_expected.to eq(false) }
end
end
context 'when in control path' 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