Created
August 27, 2009 22:13
-
-
Save npverni/176615 to your computer and use it in GitHub Desktop.
should_be_valid_with_factory macro for shoulda/factory_girl
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
class ActiveSupport::TestCase | |
self.use_transactional_fixtures = true | |
self.use_instantiated_fixtures = false | |
def self.should_be_valid_with_factory | |
klass = self.name.gsub(/Test$/, '').downcase.to_sym | |
should "be valid with factory" do | |
assert_valid Factory.build(klass) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment