Created
October 25, 2011 15:37
-
-
Save mariovisic/1313163 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
Feature: Authentication (No Web Steps, Declarative) | |
As A User | |
In order to gain access to sknet | |
I want to be able to login and logout | |
Background: | |
Given I have a valid account | |
Then I should be able to login |
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
module AuthenticationHelper | |
def fill_in_my_details | |
fill_in 'Email', :with => @current_email | |
fill_in 'Password', :with => @current_password | |
end | |
end | |
World(AuthenticationHelper) |
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
Given /^I have a valid account$/ do | |
@current_email = '[email protected]' | |
@current_password = 'candles' | |
@current_user = FactoryGirl.create(:user, :email => @current_email, :password => @current_password) | |
end | |
Then /^I should be able to login$/ do | |
visit new_user_session_path | |
fill_in_my_details | |
click_button 'Sign in' | |
page.should have_content 'Signed in' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment