Skip to content
Snippets Groups Projects
Commit 95b8616d authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Merge branch 'fix-captcha-spec-state' into 'master'

Fix global state in registrations_controller_spec

See merge request gitlab-org/gitlab-ce!32712
parents 35023d43 fa5c5221
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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.'
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