Commit f3dba6b2 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'feature_flag_trials' into 'master'

Feature flag for improved trials sign up

See merge request gitlab-org/gitlab-ee!16205
parents d979df91 60c33b8d
......@@ -2,6 +2,7 @@
class TrialRegistrationsController < RegistrationsController
before_action :check_if_gl_com
before_action :check_if_improved_trials_enabled
private
......@@ -16,4 +17,8 @@ class TrialRegistrationsController < RegistrationsController
def check_if_gl_com
render_404 unless Gitlab.com?
end
def check_if_improved_trials_enabled
render_404 unless Feature.enabled?(:improved_trial_signup)
end
end
......@@ -31,6 +31,19 @@ describe TrialRegistrationsController do
end
end
context 'when feature is turned off' do
before do
allow(Gitlab).to receive(:com?).and_return(true)
stub_feature_flags(improved_trial_signup: false)
end
it 'returns not found' do
post :create, params: { user: user_params }
expect(response.status).to eq(404)
end
end
context 'when valid' do
before do
allow(Gitlab).to receive(:com?).and_return(true)
......
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