We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Tip from Thoughtbot
# spec/factories_spec.rb 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
If you use rake to run your tests, one way to take care of this is by adding a pre-requisite to your rake spec task:
# Rakefile desc 'Run factory specs.' RSpec::Core::RakeTask.new(:factory_specs) do |t| t.pattern = './spec/factories_spec.rb' end task spec: :factory_specs