1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
Commit graph

20 commits

Author SHA1 Message Date
Joe Ferris
ef29139e3e Moved aliases out of the definition body into the definition arguments 2010-11-11 16:34:01 -06:00
Joe Ferris
3b5f90f981 Use rspec2 2010-11-11 15:54:14 -06:00
Joe Ferris
5c88bb058b Renamed Factory#factory_name to Factory#name; cleaned up Factory#human_name; bumped version 2010-10-02 00:07:54 -04:00
Joe Ferris
3bdd6a3eff Added factory aliases 2010-09-07 19:20:02 -04:00
Ben Taitelbaum
7c649b2c85 Add the attributes for the parent factory before those for the child,
so that the child can reference parent attributes; fixes gh-15
2010-09-07 17:46:45 -04:00
Joe Ferris
8b4a6a1c3a Moved definition loading syntax out of the factory class; moved everything into a FactoryGirl module 2010-07-06 20:22:02 -04:00
Joe Ferris
ac8875c818 Extracted yielded object for dsl into a proxy; moved default public api into its own file 2010-07-06 20:21:52 -04:00
Joe Ferris
f3366b69f2 Separated unit and acceptance tests to isolate Rails-related dependencies 2010-06-10 13:37:51 -04:00
John Trupiano
434f67b236 Default strategy is inherited from parent unless overridden 2010-06-08 16:52:06 -04:00
Tristan Dunn
3e577f3cd5 Clean up whitespace. 2010-06-07 15:51:18 -04:00
Michał Łomnicki
ecc6e5493e Handle namespaced classes passed as string. 2010-06-07 12:18:08 -04:00
Florian Frank
16feec01f1 Support id method in Factory. 2010-06-07 11:57:28 -04:00
Florian Frank
61b25fa2d9 Support type attribute in Factory.
The type attribute is necessary in order to use rails' single table inheritance
feature. Unfortunately this collides with Ruby's deprecated Kernel#type method
and the Factory object's method missing isn't triggered. This change undefines
the type instance method in Factory and fixes the problem.

Factory.define :foo do |b|
end

Factory.define :bar, :parent => :foo do |b|
  b.type 'Bar'
end

Factory.define :baz, :parent => :foo do |b|
  b.type 'Baz'
end
2010-06-07 11:55:23 -04:00
Jon Yurek
4753fd3e2a RR problem with method_missing, and Arel doesn't call #connection directly 2010-05-20 13:39:11 -04:00
Ben Orenstein
1e556bfe09 Attempting to define multiple factories with the same name will raise an
error.
2009-11-23 23:33:30 +08:00
Nathan Sutton
8f3b24a559 Fixing inheritance of callbacks
Since callbacks share the same names they wouldn't be inherited.
I added a check to allow them to be inherited.
2009-10-10 00:23:57 -05:00
Nathan Sutton
6e35bf9207 Adding callbacks 2009-10-09 23:46:19 -05:00
Joe Ferris
33b61c3bfb Fixed issues with some attributes being skipped and added support for linked associations in step definitions 2009-09-15 16:56:20 -04:00
Joe Ferris
760a165b2e Added step definitions for cucumber 2009-09-15 15:47:47 -04:00
Joe Ferris
683aa43fab Converted tests to specs 2009-04-13 21:15:25 -04:00