Created
December 26, 2011 22:50
-
-
Save 3den/1522252 to your computer and use it in GitHub Desktop.
Automatic Validation for all Factories
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
require 'spec_helper' | |
describe Factory do | |
FactoryGirl.factories.each do |factory| | |
context "with factory for :#{factory.name}" do | |
subject {Factory.build(factory.name)} | |
it "is valid" do | |
subject.valid?.should be, subject.errors.full_messages | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment