Speccing and fixing user list loading and adding orders to other users
This commit is contained in:
@@ -13,3 +13,8 @@ end
|
||||
step "the supplier counters in the user active list view should be updated" do
|
||||
binding.pry
|
||||
end
|
||||
|
||||
step "the original user should see the newly placed order" do
|
||||
Capybara.session_name = :default
|
||||
page.should have_content '5 x'
|
||||
end
|
||||
|
||||
@@ -37,6 +37,22 @@ step "there is a signed in user with a placed order" do
|
||||
step "the user has a placed order"
|
||||
end
|
||||
|
||||
step "there is another signed in user on the same list" do
|
||||
step 'there is another signed in user user'
|
||||
step 'the other user is part of the list'
|
||||
end
|
||||
|
||||
step 'the other user orders a product :count times' do |count|
|
||||
@list.place_order products: {@product.id => count.to_i}, user: @other_user
|
||||
end
|
||||
|
||||
step 'the other user is part of the list' do
|
||||
@other_user.active_list_id = @list.id
|
||||
@list.user_ids = @list.user_ids | [@other_user.id]
|
||||
@other_user.save
|
||||
@list.save
|
||||
end
|
||||
|
||||
step "the user clicks on the more info button for the product with name :product_name" do |product_name|
|
||||
product = @product && @product.name == product_name ? @product : Product.find_by_name(product_name)
|
||||
find(".order-product-#{product.id} .show-product-description").click
|
||||
@@ -80,3 +96,12 @@ step "the user should see an empty active order panel" do
|
||||
no_orders_message = page.evaluate_script(%|t('product_orders.no_orders')|)
|
||||
page.find('.product-orders').text.should == no_orders_message
|
||||
end
|
||||
|
||||
step 'the user is on the order products page' do
|
||||
visit "/user#/tables/#{@table.id}"
|
||||
end
|
||||
|
||||
step 'the user should see the products listed for the active list' do
|
||||
page.should have_content @heineken_beer.name
|
||||
page.should have_content @apple_pie.name
|
||||
end
|
||||
|
||||
@@ -13,3 +13,7 @@ end
|
||||
step "the user clicks on the active list link in the side menu" do
|
||||
page.execute_script %|$('.side-menu-active-list').click()|
|
||||
end
|
||||
|
||||
step "the user clicks on the order products link in the side menu" do
|
||||
page.execute_script %|$('.side-menu-list-products').click()|
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user