Created
May 5, 2011 08:55
-
-
Save johanb/956753 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Features | |
Feature: Authentication | |
In order to use GoGo app | |
As a visitor | |
I want to be able to log in | |
Scenario: Login | |
Given I am not logged in | |
When I follow "Sign in with Facebook" | |
And I allow authentication | |
Then I should see "Signed in succesfully." | |
Scenario: Failed login | |
Given I am not logged in | |
When I follow "Sign in with Facebook" | |
And I disallow authentication | |
Then I should see "Sorry, there was something wrong with your login attempt. Please try again." | |
## Steps | |
When /^I disallow authentication$/ do | |
OmniAuth.config.mock_auth[:facebook] = :invalid_credentials | |
end | |
## Controller | |
def failure | |
redirect_to root_url, :alert => 'Sorry, there was something wrong with your login attempt. Please try again.' | |
end | |
## Auth | |
match '/auth/failure' => 'sessions#failure' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment