From 143545da0d295f6de4e69120200d1f931d964be2 Mon Sep 17 00:00:00 2001 From: Rob H Date: Fri, 12 Sep 2014 23:41:26 +1000 Subject: [PATCH] Try newer syntax to fix spec failing on CI --- spec/features/admin/orders_spec.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/features/admin/orders_spec.rb b/spec/features/admin/orders_spec.rb index dd733a7009..dd4a2113e8 100644 --- a/spec/features/admin/orders_spec.rb +++ b/spec/features/admin/orders_spec.rb @@ -129,26 +129,26 @@ feature %q{ visit '/admin/orders' click_link 'New Order' - page.should have_content 'ADD PRODUCT' + expect(page).to have_content 'ADD PRODUCT' targetted_select2_search product.name, from: '#add_variant_id', dropdown_css: '.select2-drop' click_link 'Add' page.has_selector? "table.index tbody[data-hook='admin_order_form_line_items'] tr" # Wait for JS - page.should have_selector 'td', text: product.name + expect(page).to have_selector 'td', text: product.name - page.should have_select 'order_distributor_id', with_options: [distributor1.name] - page.should have_no_select 'order_distributor_id', with_options: [distributor2.name] + expect(page).to have_select 'order_distributor_id', with_options: [distributor1.name] + expect(page).to_not have_select 'order_distributor_id', with_options: [distributor2.name] - page.should have_select 'order_order_cycle_id', with_options: [order_cycle1.name] - page.should have_no_select 'order_order_cycle_id', with_options: [order_cycle2.name] + expect(page).to have_select 'order_order_cycle_id', with_options: [order_cycle1.name] + expect(page).to_not have_select 'order_order_cycle_id', with_options: [order_cycle2.name] select distributor1.name, from: 'order_distributor_id' select order_cycle1.name, from: 'order_order_cycle_id' click_button 'Update' - page.should have_selector 'h1', text: 'Customer Details' + expect(page).to have_selector 'h1', text: 'Customer Details' o = Spree::Order.last - o.distributor.should == distributor1 - o.order_cycle.should == order_cycle1 + expect(o.distributor).to eq distributor1 + expect(o.order_cycle).to eq order_cycle1 end end