diff options
author | Stan Hu <stanhu@gmail.com> | 2018-04-06 22:38:37 +0000 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2018-04-10 17:09:02 +0200 |
commit | 9df82f145653515f96282966c0bb68272a009e23 (patch) | |
tree | b920725aaf1a7b6482db59749b8548677b8cf714 | |
parent | 99ac00b1fdb29e7fec890567ba9bae3dbd8e9061 (diff) | |
download | gitlab-ce-9df82f145653515f96282966c0bb68272a009e23.tar.gz |
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
-rw-r--r-- | app/views/shared/_recaptcha_form.html.haml | 2 | ||||
-rw-r--r-- | spec/features/issues/spam_issues_spec.rb | 3 |
2 files changed, 1 insertions, 4 deletions
diff --git a/app/views/shared/_recaptcha_form.html.haml b/app/views/shared/_recaptcha_form.html.haml index 93a4301f366..a0ba1afc284 100644 --- a/app/views/shared/_recaptcha_form.html.haml +++ b/app/views/shared/_recaptcha_form.html.haml @@ -10,7 +10,7 @@ = hidden_field(resource_name, field, value: value) = hidden_field_tag(:spam_log_id, spammable.spam_log.id) = 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. = yield diff --git a/spec/features/issues/spam_issues_spec.rb b/spec/features/issues/spam_issues_spec.rb index a75ca1d42b3..73022afbda2 100644 --- a/spec/features/issues/spam_issues_spec.rb +++ b/spec/features/issues/spam_issues_spec.rb @@ -34,9 +34,6 @@ describe 'New issue', :js do 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 # recaptcha verification is skipped in test environment and it always returns true expect(page).not_to have_content('issue title') |