summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2019-09-06 20:37:40 +0000
committerJohn Jarvis <jarv@gitlab.com>2019-09-19 15:41:20 +0200
commit216a6b4fa5cf92301db6a292d1b488d11e5b30b1 (patch)
tree4fcd0bb30a1ff89b5965cb6f5fdeace0b38a84e6
parent7dc637c13e4f329fb6e200a0acf571be699cee07 (diff)
downloadgitlab-ce-12-1-stable-patch-10.tar.gz
Merge branch 'sh-fix-captcha-state-pollution-spec' into 'master'12-1-stable-patch-10
Fix order-dependent spec failures with reCAPTCHA Closes #67133 See merge request gitlab-org/gitlab-ce!32771
-rw-r--r--spec/controllers/registrations_controller_spec.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb
index faf3c990cb2..fc990a6b295 100644
--- a/spec/controllers/registrations_controller_spec.rb
+++ b/spec/controllers/registrations_controller_spec.rb
@@ -47,17 +47,12 @@ 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
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)
@@ -78,7 +73,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)