Fix product ordering pricing and improve acceptance user product ordering coverage
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user