Commit 85f4e323 authored by Stan Hu's avatar Stan Hu

Merge branch 'sh-fix-recaptcha-test' into 'master'

Fix the reCAPTCHA spec failures by not rendering the widget in test mode

Closes #45138

See merge request gitlab-org/gitlab-ce!18235
parents 9421a597 c527eadb
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
= hidden_field(resource_name, field, value: value) = hidden_field(resource_name, field, value: value)
= hidden_field_tag(:spam_log_id, spammable.spam_log.id) = hidden_field_tag(:spam_log_id, spammable.spam_log.id)
= hidden_field_tag(:recaptcha_verification, true) = hidden_field_tag(:recaptcha_verification, true)
= recaptcha_tags script: script, callback: 'recaptchaDialogCallback' = recaptcha_tags script: script, callback: 'recaptchaDialogCallback' unless Rails.env.test?
-# Yields a block with given extra params. -# Yields a block with given extra params.
= yield = yield
......
...@@ -34,9 +34,6 @@ describe 'New issue', :js do ...@@ -34,9 +34,6 @@ describe 'New issue', :js do
click_button 'Submit issue' click_button 'Submit issue'
# reCAPTCHA alerts when it can't contact the server, so just accept it and move on
page.driver.browser.switch_to.alert.accept
# it is impossible to test recaptcha automatically and there is no possibility to fill in recaptcha # it is impossible to test recaptcha automatically and there is no possibility to fill in recaptcha
# recaptcha verification is skipped in test environment and it always returns true # recaptcha verification is skipped in test environment and it always returns true
expect(page).not_to have_content('issue title') expect(page).not_to have_content('issue title')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment