Try newer syntax to fix spec failing on CI

This commit is contained in:
Rob H
2014-09-12 23:41:26 +10:00
parent 0815775bc3
commit 143545da0d

View File

@@ -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