From 589315780c759e5b8bffebd5483f0c362ff9c9e3 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Thu, 4 Sep 2025 19:07:29 +0100 Subject: [PATCH] Adds coverage to homepage alert HTML content --- spec/system/admin/configuration/content_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spec/system/admin/configuration/content_spec.rb b/spec/system/admin/configuration/content_spec.rb index 8e44066e70..497a007555 100644 --- a/spec/system/admin/configuration/content_spec.rb +++ b/spec/system/admin/configuration/content_spec.rb @@ -55,4 +55,21 @@ RSpec.describe " expect(page).to have_link("User Guide", href: "http://www.openfoodnetwork.org/platform/user-guide/") expect(find_link("User Guide")[:target]).to eq("_blank") end + + it "sets home page alert message, supporting HTML formatting" do + fill_in "home_page_alert_html", with: '
Click me:
' \ + '' \ + 'Bold hyperlink' + click_button "Update" + expect(page).to have_content "Your content has been successfully updated!" + + visit root_path + + within ".page-alert" do + expect(page).to have_content "Click me: " + expect(page).to have_selector "h6", text: "Click me: " + expect(page).to have_link "Bold hyperlink", href: "http://localhost/shops/" + expect(page).to have_selector "a strong", text: "Bold hyperlink" + end + end end