Skip to content

Instantly share code, notes, and snippets.

@keeperofthenecklace
Created August 18, 2012 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keeperofthenecklace/3388614 to your computer and use it in GitHub Desktop.
Save keeperofthenecklace/3388614 to your computer and use it in GitHub Desktop.
features/step_definitions/authentication_steps
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