From 0b7014b7d72a93ffac0d8495a9fbaf1668905980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 27 Mar 2021 00:51:26 +0100 Subject: [PATCH] Explicitly disable JS when testing JS injection CKEditor already comes with JS injection protection, so potential attackers will most likely disable CKEditor. --- spec/system/debates_spec.rb | 4 ++-- spec/system/proposals_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/system/debates_spec.rb b/spec/system/debates_spec.rb index cd7102934..5ef6e98c2 100644 --- a/spec/system/debates_spec.rb +++ b/spec/system/debates_spec.rb @@ -263,7 +263,7 @@ describe "Debates" do expect(page).to have_content error_message end - scenario "JS injection is prevented but safe html is respected" do + scenario "JS injection is prevented but safe html is respected", :no_js do author = create(:user) login_as(author) @@ -297,7 +297,7 @@ describe "Debates" do expect(page).to have_link("www.example.org", href: "http://www.example.org") end - scenario "JS injection is prevented but autolinking is respected" do + scenario "JS injection is prevented but autolinking is respected", :no_js do author = create(:user) js_injection_string = " click me http://example.org" login_as(author) diff --git a/spec/system/proposals_spec.rb b/spec/system/proposals_spec.rb index 1fed26def..177f1ee55 100644 --- a/spec/system/proposals_spec.rb +++ b/spec/system/proposals_spec.rb @@ -482,7 +482,7 @@ describe "Proposals" do expect(page).to have_content error_message end - scenario "JS injection is prevented but safe html is respected" do + scenario "JS injection is prevented but safe html is respected", :no_js do author = create(:user) login_as(author) @@ -526,7 +526,7 @@ describe "Proposals" do expect(page).to have_link("www.example.org", href: "http://www.example.org") end - scenario "JS injection is prevented but autolinking is respected" do + scenario "JS injection is prevented but autolinking is respected", :no_js do author = create(:user) js_injection_string = " click me http://example.org" login_as(author)