From 9c2a78adf21bcb0df4534ab3354bc23324a044ce Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 2 Aug 2017 15:07:18 +1000 Subject: [PATCH] Avoid warnings, use expect syntax --- spec/features/admin/orders_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/features/admin/orders_spec.rb b/spec/features/admin/orders_spec.rb index 4b5df630f1..62c2d0ce99 100644 --- a/spec/features/admin/orders_spec.rb +++ b/spec/features/admin/orders_spec.rb @@ -24,7 +24,7 @@ feature %q{ def new_order_with_distribution(distributor, order_cycle) visit 'admin/orders/new' - page.should have_selector('#s2id_order_distributor_id') + expect(page).to have_selector('#s2id_order_distributor_id') select2_select distributor.name, from: 'order_distributor_id' select2_select order_cycle.name, from: 'order_order_cycle_id' click_button 'Next' @@ -148,17 +148,17 @@ feature %q{ click_link 'Add' page.has_selector? "table.index tbody[data-hook='admin_order_form_line_items'] tr" # Wait for JS click_button 'Update' - within('h1.page-title') { page.should have_content "Customer Details" } + within('h1.page-title') { expect(page).to have_content "Customer Details" } # And I select that customer's email address and save the order targetted_select2_search @customer.email, from: '#customer_search_override', dropdown_css: '.select2-drop' click_button 'Continue' - page.should have_selector "h1.page-title", text: "Shipments" + expect(page).to have_selector "h1.page-title", text: "Shipments" # Then their addresses should be associated with the order order = Spree::Order.last - order.ship_address.lastname.should == @customer.ship_address.lastname - order.bill_address.lastname.should == @customer.bill_address.lastname + expect(order.ship_address.lastname).to eq @customer.ship_address.lastname + expect(order.bill_address.lastname).to eq @customer.bill_address.lastname end scenario "capture multiple payments from the orders index page" do