Test factories first #115

Merged
merged 1 commit into from Oct 20, 2012

Projects

None yet

2 participants

@adarsh adarsh commented on the diff Oct 19, 2012
templates/factories_spec.rb
@@ -0,0 +1,9 @@
+require 'spec_helper'
+
+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
@adarsh
adarsh Oct 19, 2012 Contributor

Is a separate block is required to exercise the build_stubbed factories?

@croaky
croaky Oct 19, 2012 Member

I don't think we want to exercise the build_stubbed factories, just test that each factory is valid.

On Oct 19, 2012, at 1:56 AM, Adarsh Pandit notifications@github.com wrote:

In templates/factories_spec.rb:

@@ -0,0 +1,9 @@
+require 'spec_helper'
+
+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
    Is a separate block is required to exercise the build_stubbed factories?


Reply to this email directly or view it on GitHub.

@croaky croaky merged commit 52444eb into master Oct 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment