add failing spec

This commit is contained in:
2014-10-01 11:29:31 +02:00
parent 056dce5f26
commit faaa06f0dc
3 changed files with 16 additions and 7 deletions
@@ -3,7 +3,7 @@ Feature: Sign up as user using facebook
@javascript
Scenario: Happy flow
Given There is no user information stored in the local storage
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
@@ -28,5 +28,13 @@ 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
Scenario: Authenciation when there is a list already active
Given there is a confirmed and open supplier
And there is a 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
Scenario: Facebook problem OmniAuth.config.mock_auth[:facebook] = :invalid_credentials
Scenario: Valid facebook login, but declines information requested by scope
@@ -36,7 +36,3 @@ step 'a new order on a table in another section is created' do
@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)
end
step "I am signed in as a user" do
step "I visit the user obtain token path"
end
@@ -1,5 +1,5 @@
step "There is no user information stored in the local storage" do
step "there is no user information stored in the local storage" do
visit '/'
page.execute_script %|Qstorage = window.localStorage|
page.evaluate_script(%|Qstorage.getItem('user_id')|).should be_blank
@@ -10,8 +10,13 @@ step "I visit the user obtain token path" do
visit user_root_path # obtain token through ember application
end
step "I am signed in as a user" do
step "there is a user" do
@user ||= create :user
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