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
+4 -4
View File
@@ -2,7 +2,7 @@ Feature: Active list view
@javascript
Scenario: Loading lists and switching back to the active list works, lists loading may unlink active list orders
Given There is an open supplier with a menu
Given there is an open supplier with a menu
And there is a signed in user with an active order
And the user is on the active list page
When the user opens the side menu
@@ -13,7 +13,7 @@ Feature: Active list view
@javascript
Scenario: Order disappears and counter adjusts when a placed order is cancelled
Given There is an open supplier with a menu
Given there is an open supplier with a menu
And there is a signed in user with a placed order
And the user is on the active list page
And the supplier orders placed counter for the user should be 1
@@ -24,7 +24,7 @@ Feature: Active list view
@javascript
Scenario: Order disappears and counter adjusts when an active order is cancelled
Given There is an open supplier with a menu
Given there is an open supplier with a menu
And there is a signed in user with an active order
And the user is on the active list page
And the supplier orders in process counter for the user should be 1
@@ -35,7 +35,7 @@ Feature: Active list view
@javascript
Scenario: Two users on the same list when one place an order
Given There is an open supplier with a menu
Given there is an open supplier with a menu
And there is a signed in user with an active order
And the user is on the active list page
And there is another signed in user on the same list
+2 -2
View File
@@ -2,7 +2,7 @@ Feature: Changing table
@javascript
Scenario: Scanning a table not yet occupied and change to it
Given There is an open supplier with a menu
Given there is an open supplier with a menu
And there is a signed in user with an active order
And the user is on the homepage
And there is another table
@@ -15,7 +15,7 @@ Feature: Changing table
@javascript
Scenario: Scanning a table already occupied
Given There is an open supplier with a menu
Given there is an open supplier with a menu
And there is a signed in user with an active order
And the user is on the homepage
And there is another table with an active list of another user
@@ -2,7 +2,7 @@ Feature: Getting product information during an order
@javascript
Scenario: Happy flow
Given There is an open supplier with a menu
Given there is an open supplier with a menu
And the product 'Heineken beer' has description 'Brewed in Amsterdam'
And I am signed in as a user
And I am on the user homepage
@@ -2,7 +2,7 @@ Feature: Joining an occupied table
@javascript
Scenario: Happy flow
Given There is an open supplier with a menu
Given there is an open supplier with a menu
And there is a signed in user with an active order
And I am on the user homepage
When another user scans the QR code on the table
@@ -16,7 +16,7 @@ Feature: Joining an occupied table
@javascript
Scenario: Original user rejects the join request
Given There is an open supplier with a menu
Given there is an open supplier with a menu
And there is a signed in user with an active order
And I am on the user homepage
When another user scans the QR code on the table
@@ -2,7 +2,7 @@ Feature: Ordering a product as a user
@javascript
Scenario: Happy flow
Given There is an open supplier with a menu
Given there is an open supplier with a menu
And I am signed in as a user
And I am on the user homepage
When the user scans a table QR code
@@ -27,7 +27,7 @@ Feature: Ordering a product as a user
@javascript
Scenario: Resetting an active order
Given There is an open supplier with a menu
Given there is an open supplier with a menu
And I am signed in as a user
And I am on the user homepage
When the user scans a table QR code
@@ -43,7 +43,7 @@ Feature: Ordering a product as a user
@javascript
Scenario: Loading lists and switching to the order products view works, lists loading may unlink active list orders
Given There is an open supplier with a menu
Given there is an open supplier with a menu
And there is a signed in user with an active order
And the user has an older list for the same supplier
And I wait 1 second
@@ -28,13 +28,14 @@ Feature: Sign up as user using facebook
And I wait 4 seconds
Then the newly created user info should be stored in the local storage
@javascipt
@javascript
Scenario: Authenciation when there is a list already active
Given there is a confirmed and open supplier
And there is a user
And there is a facebook user
And the user has an active order
When the user authenticates with facebook
Then the user should be redirected to the active list page
When I visit the user obtain token path
And I wait 1 second
Then the user should be redirected to the user order overview page
Scenario: Facebook problem OmniAuth.config.mock_auth[:facebook] = :invalid_credentials
Scenario: Valid facebook login, but declines information requested by scope
+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