mirror of
https://github.com/thoughtbot/factory_bot.git
synced 2022-11-09 11:43:51 -05:00
779eafccbd
The previous implementation of trait handling within the Definition didn't account for when implicit traits were used within other traits. This is useful if you have two different traits, but one depends on another; for example, a refunded order and a completed order could both have the attribute `completed_at` set, but refunded would additionally have `refunded_at` set: FactoryGirl.define do factory :order do trait :completed do completed_at { 3.days.ago } end trait :refunded do completed refunded_at { 1.day.ago } end end end This also tests to make sure that callbacks, custom constructors, and creation overrides work correctly when implicit traits are used within other traits. Fixes #360 |
||
---|---|---|
.. | ||
acceptance | ||
factory_girl | ||
support | ||
factory_girl_spec.rb | ||
spec_helper.rb |