Make "select all/none" tests actually test something
Since we were on the "Pending review" filter, and there were no records pending review, the code checking all checkboxes were checked/unchecked didn't test anything because there were no checkboxes on the page. So we're clicking on the "All" filter first.
This commit is contained in:
@@ -108,6 +108,9 @@ describe "Moderate budget investments" do
|
||||
create_list(:budget_investment, 2, heading: heading, author: create(:user))
|
||||
|
||||
visit moderation_budget_investments_path
|
||||
within(".menu.simple") { click_link "All" }
|
||||
|
||||
expect(page).to have_field type: :checkbox, count: 3
|
||||
|
||||
within(".js-check") { click_link "All" }
|
||||
|
||||
|
||||
@@ -128,6 +128,9 @@ describe "Moderate comments" do
|
||||
create_list(:comment, 2)
|
||||
|
||||
visit moderation_comments_path
|
||||
within(".menu.simple") { click_link "All" }
|
||||
|
||||
expect(page).to have_field type: :checkbox, count: 2
|
||||
|
||||
within(".js-check") { click_link "All" }
|
||||
|
||||
|
||||
@@ -97,6 +97,9 @@ describe "Moderate debates" do
|
||||
create_list(:debate, 2)
|
||||
|
||||
visit moderation_debates_path
|
||||
within(".menu.simple") { click_link "All" }
|
||||
|
||||
expect(page).to have_field type: :checkbox, count: 2
|
||||
|
||||
within(".js-check") { click_link "All" }
|
||||
|
||||
|
||||
@@ -108,6 +108,9 @@ describe "Moderate proposal notifications" do
|
||||
create_list(:proposal_notification, 2)
|
||||
|
||||
visit moderation_proposal_notifications_path
|
||||
within(".menu.simple") { click_link "All" }
|
||||
|
||||
expect(page).to have_field type: :checkbox, count: 2
|
||||
|
||||
within(".js-check") { click_link "All" }
|
||||
|
||||
|
||||
@@ -96,6 +96,9 @@ describe "Moderate proposals" do
|
||||
create_list(:proposal, 2)
|
||||
|
||||
visit moderation_proposals_path
|
||||
within(".menu.simple") { click_link "All" }
|
||||
|
||||
expect(page).to have_field type: :checkbox, count: 3
|
||||
|
||||
within(".js-check") { click_link "All" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user