I'm trying to create nested associations using the following code
it "builds multiple nested associations" do
equipment_1 = Fabricate(:equipment)
customer_1 = Fabricate(:customer)
customer_2 = Fabricate(:customer)
trip_1 = Fabricate(:trip, date: Date.today) do
participations { [Fabricate(:participation, customer_id:
customer_1.id )] } do
rentals { [Fabricate(:rental, equipment_id:
equipment_1.id )] }
end
end
expect(trip_1).to be_valid
end
where trip has_many participations, and participation has_many rentals
However I get an error stating unexpected keyword_do_block
Is there a way of creating deeply nested associations?
Michael