Skip to content
Snippets Groups Projects
Commit 14fe47ce authored by Mayra Cabrera's avatar Mayra Cabrera
Browse files

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
parents 1ffa66ef 95737ab1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
@@ -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)
 
Loading
Loading
@@ -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)
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment