diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2019-09-06 15:28:44 +0000 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-09-06 15:28:44 +0000 |
commit | 95b8616d135acd8672cb0b71e514ebf429ff9622 (patch) | |
tree | 8d3e49ce38151987f5c37ae4a226ad654b222065 | |
parent | 35023d435ddd4c4709f06ea24ebd92480a1a64cb (diff) | |
parent | fa5c52217d57ac425e36ec26f1aec62e5af1992e (diff) | |
download | gitlab-ce-95b8616d135acd8672cb0b71e514ebf429ff9622.tar.gz |
Merge branch 'fix-captcha-spec-state' into 'master'
Fix global state in registrations_controller_spec
See merge request gitlab-org/gitlab-ce!32712
-rw-r--r-- | spec/controllers/registrations_controller_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index 35487682462..b79a1ac4810 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -83,6 +83,13 @@ describe RegistrationsController do stub_application_setting(recaptcha_enabled: true) end + after do + # Avoid test ordering issue and ensure `verify_recaptcha` returns true + unless Recaptcha.configuration.skip_verify_env.include?('test') + Recaptcha.configuration.skip_verify_env << 'test' + end + end + it 'displays an error when the reCAPTCHA is not solved' do fail_recaptcha @@ -93,11 +100,6 @@ describe RegistrationsController do end it 'redirects to the dashboard when the recaptcha is solved' do - # Avoid test ordering issue and ensure `verify_recaptcha` returns true - unless Recaptcha.configuration.skip_verify_env.include?('test') - Recaptcha.configuration.skip_verify_env << 'test' - end - post(:create, params: user_params) expect(flash[:notice]).to include 'Welcome! You have signed up successfully.' |