summaryrefslogtreecommitdiff
path: root/spec/controllers/groups_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/groups_controller_spec.rb')
-rw-r--r--spec/controllers/groups_controller_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb
index 62171528695..a82c5681911 100644
--- a/spec/controllers/groups_controller_spec.rb
+++ b/spec/controllers/groups_controller_spec.rb
@@ -132,6 +132,29 @@ RSpec.describe GroupsController, factory_default: :keep do
end
end
end
+
+ describe 'require_verification_for_namespace_creation experiment', :experiment do
+ before do
+ sign_in(owner)
+ stub_experiments(require_verification_for_namespace_creation: :candidate)
+ end
+
+ it 'tracks a "start_create_group" event' do
+ expect(experiment(:require_verification_for_namespace_creation)).to track(
+ :start_create_group
+ ).on_next_instance.with_context(user: owner)
+
+ get :new
+ end
+
+ context 'when creating a sub-group' do
+ it 'does not track a "start_create_group" event' do
+ expect(experiment(:require_verification_for_namespace_creation)).not_to track(:start_create_group)
+
+ get :new, params: { parent_id: group.id }
+ end
+ end
+ end
end
describe 'GET #activity' do