Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# using machinist and Authlogic to crat
def login!(options = {})
user = User.make(options)
set_session_for(user)
user
end
def set_session_for(user)
UserSession.create(user)
end
def admin!(options = {})
login!(options.merge({:admin => true}))
end
# usage
test "show profile to a logged in user" do
user = login!
get :show, :id => user.id
# and so on
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.