Green specs 😄

This commit is contained in:
2014-10-02 13:10:25 +02:00
parent faaa06f0dc
commit 7c03b4c32c
13 changed files with 46 additions and 25 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ end
step "the user has an active list with a/an :order_status order" do |order_status|
@list = create :list, supplier: @supplier, table: @table, user_ids: [@user.id]
@product ||= create :product, supplier: @supplier, name: 'Beer', price: 2.34
@order = create :order, order_status.to_sym, supplier: @supplier, list: @list
@order = create :order, order_status.to_sym, supplier: @supplier, list: @list, user: @user
@product_order = create :product_order, order: @order, product: @product, quantity: 2, price: 2.34
@user.reload
@user.active_list_id = @list.id
+1 -1
View File
@@ -1,4 +1,4 @@
step "There is an open supplier with a menu" do
step "there is an open supplier with a menu" do
step 'there is a confirmed and open supplier'
@apple_pie= create :product, name: 'Apple pie', supplier: @supplier, price: 4.28
@heineken_beer = create :product, name: 'Heineken beer', supplier: @supplier, price: 2.34
@@ -14,8 +14,14 @@ step "there is a user" do
@user ||= create :user
end
step "there is a facebook user" do
if @user
raise "There already is a user, but not a facebook user"
else
@user ||= create :user, provider: 'facebook', uid: '123456790' # uid from spec_helper oauth setup
end
end
step "I am signed in as a user" do
step "there is a confirmed and open supplier"
step "there is a user"
visit test_login_admin_users_path(email: @user.email)
end