From d28c0159ab87ec949e641caab6f4f4323521e2e3 Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Fri, 17 Jun 2016 12:06:01 +1000 Subject: [PATCH] Use have_selector x, count: y; instead of all(x).count.should == y --- spec/features/admin/payment_method_spec.rb | 2 +- spec/features/admin/reports_spec.rb | 2 +- spec/features/admin/shipping_methods_spec.rb | 2 +- spec/features/consumer/shopping/checkout_spec.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/features/admin/payment_method_spec.rb b/spec/features/admin/payment_method_spec.rb index fba8e69401..45703a4d07 100644 --- a/spec/features/admin/payment_method_spec.rb +++ b/spec/features/admin/payment_method_spec.rb @@ -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 diff --git a/spec/features/admin/reports_spec.rb b/spec/features/admin/reports_spec.rb index 2bd39a3e38..e2c991a185 100644 --- a/spec/features/admin/reports_spec.rb +++ b/spec/features/admin/reports_spec.rb @@ -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 diff --git a/spec/features/admin/shipping_methods_spec.rb b/spec/features/admin/shipping_methods_spec.rb index 646b383c21..46816f5737 100644 --- a/spec/features/admin/shipping_methods_spec.rb +++ b/spec/features/admin/shipping_methods_spec.rb @@ -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 diff --git a/spec/features/consumer/shopping/checkout_spec.rb b/spec/features/consumer/shopping/checkout_spec.rb index cbb4d12554..10147b21a4 100644 --- a/spec/features/consumer/shopping/checkout_spec.rb +++ b/spec/features/consumer/shopping/checkout_spec.rb @@ -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