Simplify expectations in "select all/none" tests
This commit is contained in:
@@ -114,13 +114,11 @@ describe "Moderate budget investments" do
|
||||
|
||||
within(".js-check") { click_link "All" }
|
||||
|
||||
expect(all("input[type=checkbox]")).to all(be_checked)
|
||||
expect(all(:checkbox)).to all(be_checked)
|
||||
|
||||
within(".js-check") { click_link "None" }
|
||||
|
||||
all("input[type=checkbox]").each do |checkbox|
|
||||
expect(checkbox).not_to be_checked
|
||||
end
|
||||
all(:checkbox).each { |checkbox| expect(checkbox).not_to be_checked }
|
||||
end
|
||||
|
||||
scenario "remembering page, filter and order" do
|
||||
|
||||
@@ -134,13 +134,11 @@ describe "Moderate comments" do
|
||||
|
||||
within(".js-check") { click_link "All" }
|
||||
|
||||
expect(all("input[type=checkbox]")).to all(be_checked)
|
||||
expect(all(:checkbox)).to all(be_checked)
|
||||
|
||||
within(".js-check") { click_link "None" }
|
||||
|
||||
all("input[type=checkbox]").each do |checkbox|
|
||||
expect(checkbox).not_to be_checked
|
||||
end
|
||||
all(:checkbox).each { |checkbox| expect(checkbox).not_to be_checked }
|
||||
end
|
||||
|
||||
scenario "remembering page, filter and order" do
|
||||
|
||||
@@ -103,13 +103,11 @@ describe "Moderate debates" do
|
||||
|
||||
within(".js-check") { click_link "All" }
|
||||
|
||||
expect(all("input[type=checkbox]")).to all(be_checked)
|
||||
expect(all(:checkbox)).to all(be_checked)
|
||||
|
||||
within(".js-check") { click_link "None" }
|
||||
|
||||
all("input[type=checkbox]").each do |checkbox|
|
||||
expect(checkbox).not_to be_checked
|
||||
end
|
||||
all(:checkbox).each { |checkbox| expect(checkbox).not_to be_checked }
|
||||
end
|
||||
|
||||
scenario "remembering page, filter and order" do
|
||||
|
||||
@@ -114,13 +114,11 @@ describe "Moderate proposal notifications" do
|
||||
|
||||
within(".js-check") { click_link "All" }
|
||||
|
||||
expect(all("input[type=checkbox]")).to all(be_checked)
|
||||
expect(all(:checkbox)).to all(be_checked)
|
||||
|
||||
within(".js-check") { click_link "None" }
|
||||
|
||||
all("input[type=checkbox]").each do |checkbox|
|
||||
expect(checkbox).not_to be_checked
|
||||
end
|
||||
all(:checkbox).each { |checkbox| expect(checkbox).not_to be_checked }
|
||||
end
|
||||
|
||||
scenario "remembering page, filter and order" do
|
||||
|
||||
@@ -102,13 +102,11 @@ describe "Moderate proposals" do
|
||||
|
||||
within(".js-check") { click_link "All" }
|
||||
|
||||
expect(all("input[type=checkbox]")).to all(be_checked)
|
||||
expect(all(:checkbox)).to all(be_checked)
|
||||
|
||||
within(".js-check") { click_link "None" }
|
||||
|
||||
all("input[type=checkbox]").each do |checkbox|
|
||||
expect(checkbox).not_to be_checked
|
||||
end
|
||||
all(:checkbox).each { |checkbox| expect(checkbox).not_to be_checked }
|
||||
end
|
||||
|
||||
scenario "remembering page, filter and order" do
|
||||
|
||||
Reference in New Issue
Block a user