Skip to content

Commit 14fe47c

Browse files
author
Mayra Cabrera
committed
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
2 parents 1ffa66e + 95737ab commit 14fe47c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

spec/controllers/registrations_controller_spec.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@
7474
end
7575

7676
context 'when reCAPTCHA is enabled' do
77-
def fail_recaptcha
78-
# Without this, `verify_recaptcha` arbitrarily returns true in test env
79-
Recaptcha.configuration.skip_verify_env.delete('test')
80-
end
81-
8277
before do
8378
stub_application_setting(recaptcha_enabled: true)
8479
end
@@ -91,7 +86,7 @@ def fail_recaptcha
9186
end
9287

9388
it 'displays an error when the reCAPTCHA is not solved' do
94-
fail_recaptcha
89+
allow_any_instance_of(described_class).to receive(:verify_recaptcha).and_return(false)
9590

9691
post(:create, params: user_params)
9792

@@ -107,7 +102,6 @@ def fail_recaptcha
107102

108103
it 'does not require reCAPTCHA if disabled by feature flag' do
109104
stub_feature_flags(registrations_recaptcha: false)
110-
fail_recaptcha
111105

112106
post(:create, params: user_params)
113107

0 commit comments

Comments
 (0)