Created
September 13, 2012 23:23
-
-
Save rodrigopinto/3718550 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| FactoryGirl.factories.map(&:name).each do |factory_name| | |
| describe "The #{factory_name} factory" do | |
| it 'is valid' do | |
| build(factory_name).should be_valid | |
| end | |
| end | |
| end |
This file contains hidden or 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
| # spec/models/my_model_spec.rb | |
| describe MyModel do | |
| it 'has a valid Factory' do | |
| build(:my_model).should be_valid | |
| end | |
| end |
This file contains hidden or 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
| desc 'Run factory specs.' | |
| RSpec::Core::RakeTask.new(:factory_specs) do |t| | |
| t.pattern = './spec/factories_spec.rb' | |
| end | |
| task spec: :factory_specs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment