From 3f9dea080b293c5b898d2f2efb4f2323f302db11 Mon Sep 17 00:00:00 2001 From: Papaya Labs Date: Fri, 28 Sep 2018 09:43:00 +0200 Subject: [PATCH] Check title and slug in spec --- spec/features/admin/site_customization/pages_spec.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spec/features/admin/site_customization/pages_spec.rb b/spec/features/admin/site_customization/pages_spec.rb index 30e64afc0..b0f4a40e5 100644 --- a/spec/features/admin/site_customization/pages_spec.rb +++ b/spec/features/admin/site_customization/pages_spec.rb @@ -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