Joshua Clayton
b095f24598
Convert to expect syntax
2013-01-18 13:58:36 -05:00
Joshua Clayton
6c29b11477
Use 1.9 hash syntax
2012-03-16 16:43:23 -04:00
Joshua Clayton
eca05c948f
Remove support for :method to define build strategy
2012-03-16 13:17:15 -04:00
Joshua Clayton
791591bd58
Deprecate :method in favor of :strategy
2012-02-17 14:23:17 -05:00
Simone Carletti
4b6ada72cf
Ensure the yielded value is returned when block is given.
...
In the following example, `FactoryGirl.create(:order)` returns 0 because the last expression returns 0.
`:order` is set to 0 causing an unexpected behavior.
let(:order) {
FactoryGirl.create(:order) do |order|
order.save!
order.total_cents = 0
end
}
order
# => 0
2011-12-30 01:20:47 -05:00
Justin Ko
f32651d9b2
Calling the syntax methods with a block yields the return object. Closes #210
2011-10-14 09:39:39 -04:00
Stephan Eckardt and Josh Clayton
14b8245371
Allow factories to be modified after they've been defined.
...
This adds `FactoryGirl.modify`, which allows for reopening of factories
that've been defined elsewhere. Modifying a factory won't remove or
change callbacks, only attributes.
2011-09-02 12:05:44 -04:00
Jim Kingdon
90374818a7
Now able to specify :method => :build in a factory's association.
...
See issue #64 .
2011-08-25 15:11:01 -04:00
Joshua Clayton
0b2c4da0a4
Move DefineConstant code into macro
2011-08-19 17:21:54 -04:00
Joshua Clayton
4d8d419375
Don't require a block to be passed when defining a factory
2011-06-29 14:43:20 -04:00
Joe Ferris
a7f7e85187
Updated docs and examples for new syntax
2011-01-26 20:55:06 -05:00
Joe Ferris
6c2322a11d
New default syntax for using defined factories
2011-01-26 20:44:24 -05:00
Joe Ferris
18c562a1e6
Added 'to_create' to factory definitions, allowing a factory to use something besides #save!
2011-01-19 18:19:30 -05:00
Joe Ferris
2d1c77984b
Split up the acceptance spec; removed the acceptance model fixtures in favor of fresh definitions in each spec
2010-11-12 14:58:25 -06:00