Created
July 31, 2013 08:37
-
-
Save donbonifacio/6120384 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//top of steps file or in seperate factory file | |
require 'factory_girl' | |
Factory.define :user do |u| | |
u.login 'the_login' | |
u.email '[email protected]' | |
u.password 'password' | |
u.password_confirmation 'password' | |
# u.activated_at 'active' | |
end | |
// in steps file | |
Given /I am logged in as a user/ do | |
user = Factory(:user) | |
#when registration required | |
#user.register! | |
user.activate! | |
visits "/login" | |
fill_in("login", :with => user.login) | |
fill_in("password", :with => user.password) | |
click_button("Log in") | |
response.body.should =~ /Logged in successfully/ | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment