Fix product ordering pricing and improve acceptance user product ordering coverage

This commit is contained in:
2014-08-15 11:01:39 +02:00
parent 0e605828bd
commit 9c570fdbcd
7 changed files with 72 additions and 10 deletions
@@ -3,3 +3,13 @@ step "A new order is placed" do
@list = create :list, state: 'active', supplier: @supplier, table: @table, section: @section, user_ids: [@user.id]
@order = @list.place_order products: {@product.id => 2}, user: @user
end
step "an order with :quantity products :product_name should have been created" do |quantity, product_name|
concerning_product = Product.find_by_name(product_name)
ProductOrder.find_by_quantity_and_product_id(quantity.to_i, concerning_product.id).should be_present
end
step "no order for the product :product_name should have been created" do |product_name|
concerning_product = Product.find_by_name(product_name)
ProductOrder.find_by_product_id(concerning_product.id).should_not be_present
end