Created
September 30, 2010 17:55
-
-
Save sukima/605008 to your computer and use it in GitHub Desktop.
Using a custom shoulda macro for authlogic
This file contains 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
# 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