Files
mozo-backend/features/step_definitions/supplier/supplier_main_board_steps.rb
T
2013-03-14 16:03:10 +01:00

29 lines
808 B
Ruby

Given(/^there is an active list$/) do
create_confirmed_supplier 'supplier@qwaiter.com'
create_user 'user@qwaiter.com'
@table = FactoryGirl.create :table, supplier: @supplier
@list = FactoryGirl.create :list, supplier: @supplier, table: @table, user_ids: [@user.id]
end
Given(/^I am on the main board$/) do
visit '/supplier'
sleep 0.1
end
And(/^I am signed in$/) do
login_supplier_as 'supplier@qwaiter.com'
end
And(/^an order is placed$/) do
product = FactoryGirl.create :product, supplier: @supplier
sleep 0.1
@list.place_order @user, {product.id => 369}
end
Then(/^there is a list record for the active list$/) do
page.should have_selector "#list-row-#{@list.id}"
end
Then(/^there should be a record of the active order$/) do
page.should have_selector ".of-list-#{@list.id}"
end