Added hour transient attribute to event_scheduled factory

It allows event_scheduled to be created with custom time.
This commit is contained in:
Siddhant Bajaj 2017-04-22 01:28:49 +05:30
parent 95d459f058
commit 23473e1476

View file

@ -29,9 +29,13 @@ FactoryGirl.define do
end
factory :event_scheduled do
after(:build) do |event|
transient do
hour nil
end
after(:build) do |event, evaluator|
event.state = 'confirmed'
event.event_schedules << build(:event_schedule, event: event)
event.event_schedules << build(:event_schedule, event: event, start_time: evaluator.hour)
end
end
end