blob: 7748a4f74aeaf253336adcf5cefba942a1958b37 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
FactoryGirl.define do
factory :routing_constraint_zone, class: Chouette::RoutingConstraintZone do
sequence(:name) { |n| "Routing constraint zone #{n}" }
sequence(:objectid) { |n| "organisation:RoutingConstraintZone:lineId-routeId-#{n}:LOC" }
association :route, factory: :route
after(:build) do |zone|
route = Chouette::Route.find(zone.route_id)
zone.stop_point_ids = route.stop_points.pluck(:id).first(2)
end
end
end
|