Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harden Page List Feature Spec #2832

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions spec/features/admin/page_list_feature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
specify "can sort table of pages by name" do
visit admin_pages_path(view: "list")
page.find(".sort_link", text: "Name").click
expect(page).to have_css("thead a.sort_link.desc:contains('Name')")
within("table.list") do
expect(page).to have_css("tr:nth-child(1) td.name:contains('Page 1')")
expect(page).to have_css("tr:nth-child(2) td.name:contains('Intro')")
Expand All @@ -44,6 +45,7 @@
Timecop.travel("2020-08-25") do
visit admin_pages_path(view: "list")
page.find(".sort_link", text: "Updated at").click
expect(page).to have_css("thead a.sort_link.desc:contains('Updated at')")
within("table.list") do
expect(page).to have_css("tr:nth-child(1) td.name:contains('Intro')")
expect(page).to have_css("tr:nth-child(2) td.name:contains('Contact')")
Expand All @@ -56,6 +58,7 @@
visit admin_pages_path(view: "list")
page.find(".search_input_field").set("Page")
page.find(".search_field button").click
expect(page).to have_content("1 Page")
within("table.list") do
expect(page).to have_css("tr:nth-child(1) td.name:contains('Page 1')")
expect(page).to_not have_css("tr:nth-child(2)")
Expand All @@ -66,6 +69,7 @@
specify "can filter table of pages by status", :js do
visit admin_pages_path(view: "list")
select2("Published", from: "Status")
expect(page).to have_content("Filtered by")
within("table.list") do
expect(page.find("tr:nth-child(1) td.name", text: "Intro")).to be
expect(page).to_not have_css("tr:nth-child(2)")
Expand All @@ -76,6 +80,7 @@
specify "can filter table of pages by type", :js do
visit admin_pages_path(view: "list")
select2("Contact", from: "Page type")
expect(page).to have_content("Filtered by")
within("table.list") do
expect(page.find("tr:nth-child(1) td.name", text: "Contact")).to be
expect(page).to_not have_css("tr:nth-child(2)")
Expand Down