Skip to content

Instantly share code, notes, and snippets.

@raine
Created June 16, 2011 20:59
Show Gist options
  • Select an option

  • Save raine/1030262 to your computer and use it in GitHub Desktop.

Select an option

Save raine/1030262 to your computer and use it in GitHub Desktop.
spec/support/sessions_helper.rb
Factory.define :user do |u|
u.email 'user@example.com'
u.first_name 'Mike'
u.last_name 'Baxter'
u.password 'test123'
end
module SessionsHelper
def create_and_confirm_user(factory=:user)
user = Factory.create(factory)
user.confirm!
sign_in user
user
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment