Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module UserMacros
- def create_and_authenticate_user
- @current_user = User.find_by_username('test')
- @current_user ||= User.create!(:username => 'test',
- :password => 'test',
- :password_confirmation => 'test')
- visit login_path
- fill_in 'username', :with => 'test'
- fill_in 'password', :with => 'test'
- click_button 'Log in'
- current_path.should == root_path
- end
- end
Add Comment
Please, Sign In to add comment