Using RSpec and Factory Girl, I create a record that when created, has associated 'hours' records automatically created in after_create.
But I want to test with the non-default hours, preferably ones I define in factory girl factories. Here's what I'm thinking I'd like to do:
before (:all) do
@business = Factory(:business_one)
# when that business is saved, a set of default hours is automatically saved as well
# how would I now update the hours with fixtures?
# so, ideally something like:
@business.hours[0] << Factory(:day_one)
@business.hours[1] << Factory(:day_two)
...etc...
end
Is this doable somehow or do I need to approach this differently?