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

7 commits

Author SHA1 Message Date
Joshua Clayton
f1fd650048 Clean up documentation 2012-05-05 02:31:31 -04:00
Joshua Clayton
7234f9f07e Style cleanup 2012-05-05 01:14:21 -04:00
Joshua Clayton
f68a617a8d Remove deprecated way of ignoring attributes 2012-03-16 13:17:15 -04:00
Joshua Clayton
9472a14467 Move around requires 2011-11-19 16:34:31 -05:00
Joshua Clayton
180eb8bec7 Refactor definition_proxy_spec
This introduces a couple of things: firstly, there's now a MockFactory
that allows for introspection instead of spying all over the place. This
should make tests a lot less brittle. Secondly, a couple of handy
matchers have been made available to perform assertions against the
mock.
2011-10-14 17:21:29 -04:00
Joshua Clayton
dc32fd69e8 Change syntax for ignoring attributes to use block syntax instead of
calling ignore on individual declarations.

Old syntax:

    factory :user do
      rockstar(true).ignore
      four { 2 + 2 }.ignore

      name { "John Doe#{" - Rockstar" if rockstar}" }
    end

New syntax:

    factory :user do
      ignore do
        rockstar true
        four     { 2 + 2 }
      end

      name { "John Doe#{" - Rockstar" if rockstar}" }
    end
2011-10-09 16:46:57 -04:00
Joe Ferris and Josh Clayton
a154e64da1 Introduce declarations
Declarations are another layer of abstraction between defining the
factories via the DSL and compiling the factories and their attributes.

Declarations know how to return their attribute(s), and running a
factory compiles the declarations before building all attributes on the
factory. This moves all the attribute compilation logic into one
centralized location on the Factory instance, which means traits (and
potentially other features down the road) can have individual attributes
overridden within child factories or through FactoryGirl.modify

Closes #205
2011-09-23 13:14:02 -04:00