From 45f2abcb1c75795a68da86c05be7ab7965a77a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 27 Mar 2021 00:49:34 +0100 Subject: [PATCH] Explicitly disable JavaScript with honeypot fields These fields are hidden for users with a browser supporting CSS and is only there to fool bots, so we're testing the case of an attack by bots using browsers with no CSS support. --- spec/system/budgets/investments_spec.rb | 2 +- spec/system/debates_spec.rb | 2 +- spec/system/organizations_spec.rb | 2 +- spec/system/proposals_spec.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/system/budgets/investments_spec.rb b/spec/system/budgets/investments_spec.rb index 4ecbb6fa8..86776909d 100644 --- a/spec/system/budgets/investments_spec.rb +++ b/spec/system/budgets/investments_spec.rb @@ -501,7 +501,7 @@ describe "Budget Investments" do context "Phase I - Accepting" do before { budget.update(phase: "accepting") } - scenario "Create with invisible_captcha honeypot field" do + scenario "Create with invisible_captcha honeypot field", :no_js do login_as(author) visit new_budget_investment_path(budget) diff --git a/spec/system/debates_spec.rb b/spec/system/debates_spec.rb index 58ce3fa31..cd7102934 100644 --- a/spec/system/debates_spec.rb +++ b/spec/system/debates_spec.rb @@ -219,7 +219,7 @@ describe "Debates" do expect(page).to have_content I18n.l(Debate.last.created_at.to_date) end - scenario "Create with invisible_captcha honeypot field" do + scenario "Create with invisible_captcha honeypot field", :no_js do author = create(:user) login_as(author) diff --git a/spec/system/organizations_spec.rb b/spec/system/organizations_spec.rb index b56370b12..97688c9c4 100644 --- a/spec/system/organizations_spec.rb +++ b/spec/system/organizations_spec.rb @@ -22,7 +22,7 @@ describe "Organizations" do expect(user.organization).not_to be_verified end - scenario "Create with invisible_captcha honeypot field" do + scenario "Create with invisible_captcha honeypot field", :no_js do visit new_organization_registration_path fill_in "user_organization_attributes_name", with: "robot" diff --git a/spec/system/proposals_spec.rb b/spec/system/proposals_spec.rb index 13dd0e0a3..1fed26def 100644 --- a/spec/system/proposals_spec.rb +++ b/spec/system/proposals_spec.rb @@ -392,7 +392,7 @@ describe "Proposals" do expect(page).to have_content I18n.l(Proposal.last.created_at.to_date) end - scenario "Create with invisible_captcha honeypot field" do + scenario "Create with invisible_captcha honeypot field", :no_js do author = create(:user) login_as(author)