Refactors custom page view and include specs
This commit is contained in:
@@ -72,6 +72,45 @@ feature "Custom Pages" do
|
||||
expect(page).not_to have_content("Print this info")
|
||||
end
|
||||
|
||||
scenario "Show all fields and text with links" do
|
||||
custom_page = create(:site_customization_page, :published,
|
||||
slug: "slug-with-all-fields-filled",
|
||||
title: "Custom page",
|
||||
subtitle: "This is my new custom page",
|
||||
content: "Text for new custom page with a link to https://consul.dev",
|
||||
print_content_flag: true,
|
||||
locale: "en"
|
||||
)
|
||||
|
||||
visit custom_page.url
|
||||
|
||||
expect(page).to have_title("Custom page")
|
||||
expect(page).to have_selector("h1", text: "Custom page")
|
||||
expect(page).to have_selector("h2", text: "This is my new custom page")
|
||||
expect(page).to have_content("Text for new custom page with a link to https://consul.dev")
|
||||
expect(page).to have_link("https://consul.dev")
|
||||
expect(page).to have_content("Print this info")
|
||||
end
|
||||
|
||||
scenario "Don't show subtitle if its blank" do
|
||||
custom_page = create(:site_customization_page, :published,
|
||||
slug: "slug-without-subtitle",
|
||||
title: "Custom page",
|
||||
subtitle: "",
|
||||
content: "Text for new custom page",
|
||||
print_content_flag: false,
|
||||
locale: "en"
|
||||
)
|
||||
|
||||
visit custom_page.url
|
||||
|
||||
expect(page).to have_title("Custom page")
|
||||
expect(page).to have_selector("h1", text: "Custom page")
|
||||
expect(page).to have_content("Text for new custom page")
|
||||
expect(page).not_to have_selector("h2")
|
||||
expect(page).not_to have_content("Print this info")
|
||||
end
|
||||
|
||||
scenario "Listed in more information page" do
|
||||
custom_page = create(:site_customization_page, :published,
|
||||
slug: "another-slug", title: "Another custom page",
|
||||
|
||||
Reference in New Issue
Block a user