Use have_selector x, count: y; instead of all(x).count.should == y

This commit is contained in:
Rob Harrington
2016-06-17 12:06:01 +10:00
parent e40ecae681
commit d28c0159ab
4 changed files with 4 additions and 4 deletions

View File

@@ -135,7 +135,7 @@ feature %q{
pm2
visit spree.admin_payment_methods_path
page.all('td', text: 'Two').count.should == 1
page.should have_selector 'td', text: 'Two', count: 1
end

View File

@@ -124,7 +124,7 @@ feature %q{
table.sort.should == [
["Hub", "Code", "First Name", "Last Name", "Supplier", "Product", "Variant", "Quantity", "TempControlled?"]
].sort
all('table#listing_orders tbody tr').count.should == 5 # Totals row per order
page.should have_selector 'table#listing_orders tbody tr', count: 5 # Totals row per order
end
scenario "Pack By Supplier" do

View File

@@ -123,7 +123,7 @@ feature 'shipping methods' do
visit spree.admin_shipping_methods_path
page.all('td', text: 'Two').count.should == 1
page.should have_selector 'td', text: 'Two', count: 1
end
pending "shows me only shipping methods for the enterprise I select" do

View File

@@ -300,7 +300,7 @@ feature "As a consumer I want to check out my cart", js: true do
# Does not show duplicate shipping fee
visit checkout_path
page.all("th", text: "Shipping").count.should == 1
page.should have_selector "th", text: "Shipping", count: 1
end
end
end