Check title and slug in spec
This commit is contained in:
@@ -11,6 +11,7 @@ feature "Admin custom pages" do
|
||||
custom_page = create(:site_customization_page)
|
||||
visit admin_site_customization_pages_path
|
||||
|
||||
expect(page).to have_content(custom_page.title)
|
||||
expect(page).to have_content(custom_page.slug)
|
||||
end
|
||||
|
||||
@@ -22,6 +23,7 @@ feature "Admin custom pages" do
|
||||
click_link "Custom pages"
|
||||
end
|
||||
|
||||
expect(page).not_to have_content "An example custom page"
|
||||
expect(page).not_to have_content "example-page"
|
||||
|
||||
click_link "Create new page"
|
||||
@@ -33,13 +35,14 @@ feature "Admin custom pages" do
|
||||
|
||||
click_button "Create Custom page"
|
||||
|
||||
expect(page).to have_content "An example custom page"
|
||||
expect(page).to have_content "example-page"
|
||||
end
|
||||
end
|
||||
|
||||
context "Update" do
|
||||
scenario "Valid custom page" do
|
||||
create(:site_customization_page, title: "An example custom page")
|
||||
create(:site_customization_page, title: "An example custom page", slug: "custom-example-page")
|
||||
visit admin_root_path
|
||||
|
||||
within("#side_menu") do
|
||||
@@ -49,12 +52,15 @@ feature "Admin custom pages" do
|
||||
click_link "An example custom page"
|
||||
|
||||
expect(page).to have_selector("h2", text: "An example custom page")
|
||||
expect(page).to have_selector("input[value='custom-example-page']")
|
||||
|
||||
fill_in "site_customization_page_title_en", with: "Another example custom page"
|
||||
fill_in "site_customization_page_slug", with: "another-custom-example-page"
|
||||
click_button "Update Custom page"
|
||||
|
||||
expect(page).to have_content "Page updated successfully"
|
||||
expect(page).to have_content "Another example custom page"
|
||||
expect(page).to have_content "another-custom-example-page"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -64,6 +70,7 @@ feature "Admin custom pages" do
|
||||
|
||||
click_link "Delete page"
|
||||
|
||||
expect(page).not_to have_content("An example custom page")
|
||||
expect(page).not_to have_content "An example custom page"
|
||||
expect(page).not_to have_content "example-page"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user