I've been banging my head over this. I want to be able to overwrite attributes on top of traits. I've been reading the documentation and some internet examples but I can't get it to work.
This is sort of what I want to do:
test "..." do
#overwrite start_time
middle = create( :basic_instant_instance, start: 1.hours.ago)
end
FactoryGirl.define do
factory :instant_instance do
trait :active_now do
#attributes...
transient do
start nil
end
#overwrite start_time
start_time start.present? ? start : Time.now
end
factory :basic_instant_instance, traits: [:active_now]
end
I keep getting:
ArgumentError: Trait not registered: start