From 9a1dd9992ab19293bea5c7818c7f98a828b5c492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 16 Jan 2023 17:50:02 +0100 Subject: [PATCH] Don't depend on the "Help" link in tests In order to leave the page using turbolinks and then going back, we were clicking on the "Help" page link, but this link doesn't have to be available on every Consul Democracy installation. So we're using the link to the homepage instead. --- spec/shared/system/mappable.rb | 12 ++++++------ spec/system/legislation/draft_versions_spec.rb | 8 ++++---- spec/system/proposals_spec.rb | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/spec/shared/system/mappable.rb b/spec/shared/system/mappable.rb index 66c4742b8..3ff5e2b0d 100644 --- a/spec/shared/system/mappable.rb +++ b/spec/shared/system/mappable.rb @@ -88,9 +88,9 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, expect(page).to have_content "User management" else - click_link "Help" + click_link "CONSUL" - expect(page).to have_content "CONSUL is a platform for citizen participation" + expect(page).to have_content "Most active proposals" end go_back @@ -121,9 +121,9 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, expect(page).to have_content "User management" else - click_link "Help" + click_link "CONSUL" - expect(page).to have_content "CONSUL is a platform for citizen participation" + expect(page).to have_content "Most active proposals" end go_back @@ -154,9 +154,9 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, expect(page).to have_content "User management" else - click_link "Help" + click_link "CONSUL" - expect(page).to have_content "CONSUL is a platform for citizen participation" + expect(page).to have_content "Most active proposals" end go_back diff --git a/spec/system/legislation/draft_versions_spec.rb b/spec/system/legislation/draft_versions_spec.rb index fac192a47..48ea95ce9 100644 --- a/spec/system/legislation/draft_versions_spec.rb +++ b/spec/system/legislation/draft_versions_spec.rb @@ -278,9 +278,9 @@ describe "Legislation Draft Versions" do expect(page).to have_css(".annotator-hl", count: 1) - click_link "Help" + click_link "CONSUL" - expect(page).to have_content "CONSUL is a platform for citizen participation" + expect(page).to have_content "Most active proposals" go_back @@ -296,9 +296,9 @@ describe "Legislation Draft Versions" do find(:css, ".annotator-hl").click - click_link "Help" + click_link "CONSUL" - expect(page).to have_content "CONSUL is a platform for citizen participation" + expect(page).to have_content "Most active proposals" go_back diff --git a/spec/system/proposals_spec.rb b/spec/system/proposals_spec.rb index eccd13746..9c63bbb8c 100644 --- a/spec/system/proposals_spec.rb +++ b/spec/system/proposals_spec.rb @@ -214,9 +214,9 @@ describe "Proposals" do Setting["org_name"] = "CONSUL" proposal = create(:proposal) visit proposal_path(proposal) - click_link "Help" + click_link "CONSUL" - expect(page).to have_content "CONSUL is a platform for citizen participation" + expect(page).to have_content "Most active proposals" go_back