Green user sign in flow

This commit is contained in:
2014-12-24 09:34:05 +01:00
parent a30b17648d
commit 4faee9aa6e
6 changed files with 126 additions and 37 deletions
@@ -1,41 +1,72 @@
Feature: Sign up as user using facebook
Note that facebook is automatically signing in
@javascript
Scenario: Happy flow
Scenario: Happy flow facebook without list
Given there is no user information stored in the local storage
When I visit the user obtain token path
Then I should be signed in as a user through facebook
When I wait 4 seconds
Then I should be redirected to the user home
When the user is on the homepage
Then the user is redirected to the sign in page
When the user clicks the sign in via facebook button
#When I visit the user obtain token path
Then the user should be redirected to the homepage
And the user should be signed in as the facebook user
And the newly created user info should be stored in the local storage
@javascript
Scenario: Already signed in user visits obtain token path
Given I am signed in as a user
When I visit '/user'
And I wait 4 seconds
Then I should be redirected to the user home
And the newly created user info should be stored in the local storage
@javascript
Scenario: Expired token
Given I visit '/user'
And I wait 4 seconds
And I am signed out as a user
When the user authentication token changes
And I visit '/user'
And I wait 4 seconds
Then the newly created user info should be stored in the local storage
@javascript
Scenario: Authenciation when there is a list already active
Scenario: Authencicate with facebook when there is a list already active
Given there is a confirmed and open supplier
And there is a facebook user
And the user has an active order
When I visit the user obtain token path
And I wait 1 second
#When I visit the user obtain token path
When the user is on the homepage
Then the user is redirected to the sign in page
When the user clicks the sign in via facebook button
Then the user should be redirected to the user order overview page
@javascript
Scenario: Happy flow instagram without list
Given there is no user information stored in the local storage
When the user is on the homepage
Then the user is redirected to the sign in page
When the user clicks the sign in via instagram button
#When I visit the user obtain token path
Then the user should be redirected to the homepage
And the user should be signed in as the instagram user
And the newly created user info should be stored in the local storage
@javascript
Scenario: Authencicate with instagram when there is a list already active
Given there is a confirmed and open supplier
And there is a instagram user
And the user has an active order
#When I visit the user obtain token path
When the user is on the homepage
Then the user is redirected to the sign in page
When the user clicks the sign in via instagram button
Then the user should be redirected to the user order overview page
@javascript
Scenario: Already signed in user loads the application
Given I am signed in as a user
When the user is on the homepage
#And I open the debugger
#Then the user is redirected to the sign in page
#When the user clicks the sign in via facebook button
#When I visit '/user'
#And I wait 4 seconds
Then the user should be redirected to the homepage
And the newly created user info should be stored in the local storage
@javascript @broken
Scenario: Expired token
Given there is no user information stored in the local storage
When the user is on the homepage
Then the user is redirected to the sign in page
When the user clicks the sign in via facebook button
Then the user should be redirected to the homepage
When the user has no active session
And the user authentication token changes
When the user is on the homepage
Then the newly created user info should be stored in the local storage
Scenario: Facebook problem OmniAuth.config.mock_auth[:facebook] = :invalid_credentials
Scenario: Valid facebook login, but declines information requested by scope