diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2019-09-06 23:37:40 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-09-06 23:37:40 +0300 |
commit | 14fe47cec7a82299b88fd9b7e61e99c1a90bbc17 (patch) | |
tree | c928bd7d729edfabc885b18510243669fcf2614b /spec/controllers | |
parent | 1ffa66effbc9272ac9755ba29fab2fd1b3d93db5 (diff) | |
parent | 95737ab1ce71c93b17e6728b0dcada3c1e3d14f8 (diff) |
Merge branch 'sh-fix-captcha-state-pollution-spec' into 'master'
Fix order-dependent spec failures with reCAPTCHA
Closes #67133
See merge request gitlab-org/gitlab-ce!32771
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/registrations_controller_spec.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index b79a1ac4810..5d87dbdee8b 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -74,11 +74,6 @@ describe RegistrationsController do end context 'when reCAPTCHA is enabled' do - def fail_recaptcha - # Without this, `verify_recaptcha` arbitrarily returns true in test env - Recaptcha.configuration.skip_verify_env.delete('test') - end - before do stub_application_setting(recaptcha_enabled: true) end @@ -91,7 +86,7 @@ describe RegistrationsController do end it 'displays an error when the reCAPTCHA is not solved' do - fail_recaptcha + allow_any_instance_of(described_class).to receive(:verify_recaptcha).and_return(false) post(:create, params: user_params) @@ -107,7 +102,6 @@ describe RegistrationsController do it 'does not require reCAPTCHA if disabled by feature flag' do stub_feature_flags(registrations_recaptcha: false) - fail_recaptcha post(:create, params: user_params) |