Skip to content

Instantly share code, notes, and snippets.

@sukima
Created September 30, 2010 17:55
Show Gist options
  • Save sukima/605008 to your computer and use it in GitHub Desktop.
Save sukima/605008 to your computer and use it in GitHub Desktop.
Using a custom shoulda macro for authlogic
# Sets the current person in the session from the person fixtures.
def logged_in_as(person, &block)
context "logged in as #{person}" do
setup do
@instructor = Factory(instructor) if instructor.is_a? Symbol
InstructorSession.create(instructor)
end
merge_block(&block)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment