Skip to content

Instantly share code, notes, and snippets.

@timlinquist
Created September 27, 2011 18:04
Show Gist options
  • Select an option

  • Save timlinquist/1245778 to your computer and use it in GitHub Desktop.

Select an option

Save timlinquist/1245778 to your computer and use it in GitHub Desktop.
Factory girl bug
#stubs :unit association and returns Array
before( :each ) do
@store = create :store
4.times { create :unit, :unit_ownership => @store }
end
#creates necessary relationship between store and units
before( :each ) do
@store = create :store
unit1, unit2, unit3, unit4 = create(:unit), create(:unit), create(:unit), build(:unit)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment