Created
October 5, 2010 20:38
-
-
Save seeflanigan/612286 to your computer and use it in GitHub Desktop.
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
def [your_conventional_method_name_here] | |
@foo ||= Factory(:foo) | |
@foo.authorize! | |
end |
Shoulda, and Matchy. FactoryGirl has callbacks that seem to fit the use case, @mbleigh suggested trying that approach. Another suggestion was to make the factory return an authorized or confirmed user. Seems to me like taking that happy path approach, and creating a factory for unconfirmed/unauthorized users to test those cases (they are fewer in number) is a reasonable proposition.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if you are using rspec you could use a shared behavior so that you have:
if not, maybe that gives you some more ideas to choose from :)