diff --git a/apps/state/config/config.exs b/apps/state/config/config.exs index f230bb25..27cb1c69 100644 --- a/apps/state/config/config.exs +++ b/apps/state/config/config.exs @@ -264,14 +264,35 @@ config :state, :stops_on_route, config :state, :stops_on_route, stop_order_overrides: %{ {"CR-Franklin", 0} => [ - ["Norwood Central", "Windsor Gardens", "Plimptonville", "Walpole"], + [ + "place-NEC-2203", + "place-DB-2265", + "place-DB-2258", + "place-DB-2249", + "place-DB-2240", + "place-DB-2230", + "place-DB-2222", + "place-DB-2205", + "place-DB-0095", + "place-FB-0109" + ], ["place-FB-0148", "place-FB-0166", "place-FB-0177", "place-FB-0191"], - ["Walpole", "Foxboro", "Norfolk"], ["place-FB-0191", "place-FS-0049", "place-FB-0230"] ], {"CR-Franklin", 1} => [ - ["Norfolk", "Foxboro", "Walpole"], - ["place-FB-0230", "place-FS-0049", "place-FB-0191"] + ["place-FB-0230", "place-FS-0049", "place-FB-0191"], + [ + "place-FB-0109", + "place-DB-0095", + "place-DB-2205", + "place-DB-2222", + "place-DB-2230", + "place-DB-2240", + "place-DB-2249", + "place-DB-2258", + "place-DB-2265", + "place-NEC-2203" + ] ], {"CR-Fairmount", 0} => [ ["Readville", "Dedham Corp Center", "Foxboro"], @@ -455,13 +476,6 @@ config :state, :stops_on_route, config :state, :stops_on_route, not_on_route: %{ {"CR-Franklin", 0} => [ - "place-DB-2265", - "place-DB-2258", - "place-DB-2249", - "place-DB-2240", - "place-DB-2230", - "place-DB-2222", - "place-DB-2205", "place-NEC-2173", "place-NEC-2139", "place-NEC-2108", @@ -473,13 +487,6 @@ config :state, :stops_on_route, "place-NEC-1659" ], {"CR-Franklin", 1} => [ - "place-DB-2265", - "place-DB-2258", - "place-DB-2249", - "place-DB-2240", - "place-DB-2230", - "place-DB-2222", - "place-DB-2205", "place-NEC-2173", "place-NEC-2139", "place-NEC-2108", diff --git a/apps/state/test/state/stops_on_route_test.exs b/apps/state/test/state/stops_on_route_test.exs index f6c5eb55..8947da46 100644 --- a/apps/state/test/state/stops_on_route_test.exs +++ b/apps/state/test/state/stops_on_route_test.exs @@ -285,10 +285,10 @@ defmodule State.StopsOnRouteTest do test "shows Plimptonville after Windsor Gardens even when they don't share a trip" do State.Stop.new_state([ %Model.Stop{id: "place-sstat"}, - %Model.Stop{id: "Windsor Gardens"}, - %Model.Stop{id: "Plimptonville"}, - %Model.Stop{id: "Walpole"}, - %Model.Stop{id: "Franklin"} + %Model.Stop{id: "place-FB-0166"}, + %Model.Stop{id: "place-FB-0177"}, + %Model.Stop{id: "place-FB-0191"}, + %Model.Stop{id: "place-FB-0275"} ]) State.Route.new_state([%Model.Route{id: "CR-Franklin"}]) @@ -310,28 +310,36 @@ defmodule State.StopsOnRouteTest do State.Schedule.new_state([ %Model.Schedule{trip_id: "via-plimptonville", stop_id: "place-sstat", stop_sequence: 1}, - %Model.Schedule{trip_id: "via-plimptonville", stop_id: "Plimptonville", stop_sequence: 2}, - %Model.Schedule{trip_id: "via-plimptonville", stop_id: "Franklin", stop_sequence: 3}, + %Model.Schedule{trip_id: "via-plimptonville", stop_id: "place-FB-0177", stop_sequence: 2}, + %Model.Schedule{trip_id: "via-plimptonville", stop_id: "place-FB-0275", stop_sequence: 3}, # Windsor Gardens trip has more stops because this bug only shows up when the merge # has windor gardens on the left and plimptonville on the right. # They're sorted by length before merging, so this forces them to be in the order to make the bug appear. %Model.Schedule{trip_id: "via-windsor-gardens", stop_id: "place-sstat", stop_sequence: 1}, %Model.Schedule{ trip_id: "via-windsor-gardens", - stop_id: "Windsor Gardens", + stop_id: "place-FB-0166", stop_sequence: 2 }, - %Model.Schedule{trip_id: "via-windsor-gardens", stop_id: "Walpole", stop_sequence: 3}, - %Model.Schedule{trip_id: "via-windsor-gardens", stop_id: "Franklin", stop_sequence: 4} + %Model.Schedule{ + trip_id: "via-windsor-gardens", + stop_id: "place-FB-0191", + stop_sequence: 3 + }, + %Model.Schedule{ + trip_id: "via-windsor-gardens", + stop_id: "place-FB-0275", + stop_sequence: 4 + } ]) update!() stop_ids = by_route_id("CR-Franklin") - assert Enum.filter(stop_ids, &(&1 in ["Windsor Gardens", "Plimptonville"])) == [ - "Windsor Gardens", - "Plimptonville" + assert Enum.filter(stop_ids, &(&1 in ["place-FB-0166", "place-FB-0177"])) == [ + "place-FB-0166", + "place-FB-0177" ] end