prepare for RSpec 3.0

This commit is contained in:
wvengen 2014-08-19 11:39:33 +02:00
parent 61a1efdfcf
commit 21838e9c84
7 changed files with 41 additions and 40 deletions

View file

@ -57,7 +57,7 @@ describe 'settling an order', :type => :feature do
page.driver.browser.switch_to.alert.accept
end
expect(page).to_not have_selector("#order_article_#{oa.id}")
expect(OrderArticle.exists?(oa.id)).to be_true
expect(OrderArticle.exists?(oa.id)).to be true
oa.reload
expect(oa.quantity).to eq(4)
expect(oa.tolerance).to eq(0)
@ -74,7 +74,7 @@ describe 'settling an order', :type => :feature do
page.driver.browser.switch_to.alert.accept
end
expect(page).to_not have_selector("#order_article_#{oa.id}")
expect(OrderArticle.exists?(oa.id)).to be_false
expect(OrderArticle.exists?(oa.id)).to be false
end
it 'keeps ordered quantities when GroupOrderArticle is deleted from resulting order' do
@ -84,8 +84,8 @@ describe 'settling an order', :type => :feature do
click_link I18n.t('ui.delete')
end
expect(page).to_not have_selector("#group_order_article_#{goa1.id}")
expect(OrderArticle.exists?(oa.id)).to be_true
expect(GroupOrderArticle.exists?(goa1.id)).to be_true
expect(OrderArticle.exists?(oa.id)).to be true
expect(GroupOrderArticle.exists?(goa1.id)).to be true
goa1.reload
expect(goa1.result).to eq(0)
expect(goa1.quantity).to eq(3)
@ -100,8 +100,8 @@ describe 'settling an order', :type => :feature do
click_link I18n.t('ui.delete')
end
expect(page).to_not have_selector("#group_order_article_#{goa1.id}")
expect(OrderArticle.exists?(oa.id)).to be_true
expect(GroupOrderArticle.exists?(goa1.id)).to be_false
expect(OrderArticle.exists?(oa.id)).to be true
expect(GroupOrderArticle.exists?(goa1.id)).to be false
end
it 'keeps product when amount is set to zero' do
@ -116,7 +116,7 @@ describe 'settling an order', :type => :feature do
# make sure it still works after reloading
visit new_finance_order_path(order_id: order.id)
expect(page).to have_selector("#order_article_#{oa.id}")
expect(OrderArticle.exists?(oa.id)).to be_true
expect(OrderArticle.exists?(oa.id)).to be true
oa.reload
expect(oa.units_to_order).to eq(0)
end