Created
August 18, 2012 17:35
-
-
Save keeperofthenecklace/3388614 to your computer and use it in GitHub Desktop.
features/step_definitions/authentication_steps
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 /^a user visits the signin page$/ do | |
visit signin_path | |
end | |
When /^he submits invalid information$/ do | |
click_button "Sign in" | |
end | |
Then /^he should see an error message$/ do | |
page.should have_selector('div.alert.alert-error') | |
end | |
Given /^the user has an account$/ do | |
@user = User.create(name: "Albert McKeever", email: "kotn_ep1@hotmail.com", | |
password: "foobar", password_confirmation: "foobar") | |
end | |
Given /^the user submits valid signin information$/ do | |
fill_in "Email", with: @user.email | |
fill_in "Password", with: @user.password | |
click_button "Sign in" | |
end | |
#Then /^he should see his profile page$/ do | |
#page.should have_selector('title', text: @user.name) | |
#end | |
Then /^he should see a signout link$/ do | |
page.should have_link('Sign out', href: signout_path) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment