Created
March 28, 2013 14:42
-
-
Save jimjh/5263666 to your computer and use it in GitHub Desktop.
have_a_valid_factory - a custom Shoulda/RSpec matcher
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
RSpec::Matchers.define :have_a_valid_factory do | |
match do |subject| | |
factory = subject.class.name.underscore.to_sym | |
FactoryGirl.build(factory).should be_valid | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I like the idea, but I don't like the fact that the be_valid overrides the description...