We like passing specs

This commit is contained in:
2015-04-29 10:55:24 +02:00
parent e4e7198af5
commit dcd8c13e57
6 changed files with 15 additions and 12 deletions
+1 -1
View File
@@ -20,5 +20,5 @@ step 'a new order on a table in another section is created' do
# @new_section = create :section, title: 'Terrace', supplier: @supplier
# @new_table = create :table, number: 59, section: @new_section, supplier: @supplier
@new_list = create :list, section: @other_section, table: @other_table, supplier: @supplier, user_ids: [@user.id]
@new_order = @new_list.place_order(products: {@product.id => 3}, user: @user)
@new_order = @new_list.place_order(product_orders: [ {'product_id' => @product.id, 'quantity' => 3}], user: @user)
end
+1 -1
View File
@@ -1,7 +1,7 @@
step "A new order is placed" do
@user ||= create :user
@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
@order = @list.place_order product_orders: [{ 'product_id' => @product.id, 'quantity' => 2}], user: @user
end
step "an order with :quantity products :product_name should have been created" do |quantity, product_name|
+1 -1
View File
@@ -9,7 +9,7 @@ step "the order should be marked as delivered" do
end
step "another order is placed" do
@new_order = @list.place_order(products: {@product.id => 5}, user: @user)
@new_order = @list.place_order(product_orders: [{ 'product_id' => @product.id, 'quantity' => 5}], user: @user)
end
step "the user order should be created as a new order" do
@@ -43,7 +43,7 @@ step "there is another signed in user on the same list" do
end
step 'the other user orders a product :count times' do |count|
@list.place_order products: {@product.id => count.to_i}, user: @other_user
@list.place_order product_orders: [{'product_id' => @product.id, 'quantity' => count.to_i}], user: @other_user
end
step 'the other user is part of the list' do