Prepare the spec to be factorized and to be used in different context

This commit is contained in:
Jean-Baptiste Bellet
2023-02-14 14:48:35 +01:00
committed by Maikel Linke
parent 512cb44df5
commit a56f061663

View File

@@ -9,13 +9,22 @@ describe "Footer Links" do
expect(page).to have_link "cookies policy"
end
it "opens cookies policy page" do
visit root_path
click_link "cookies policy"
within "div.reveal-modal" do
expect(page).to have_content "How We Use Cookies"
shared_examples "opens the cookie policy modal" do |content|
it "with the right content" do
within "div.reveal-modal" do
expect(page).to have_content content
end
end
end
context "when english is the default language" do
before do
visit root_path
click_link "cookies policy"
end
it_behaves_like "opens the cookie policy modal", "How We Use Cookies"
end
end
describe "privacy policy link" do