diff --git a/test/concentrate/group_filter/cancelled_trip_test.exs b/test/concentrate/group_filter/cancelled_trip_test.exs index 2d5b31b1..78bdd00a 100644 --- a/test/concentrate/group_filter/cancelled_trip_test.exs +++ b/test/concentrate/group_filter/cancelled_trip_test.exs @@ -69,6 +69,7 @@ defmodule Concentrate.GroupFilter.CancelledTripTest do test "cancels the group if all stop updates have already been given a skipped status" do td = TripDescriptor.new( + route_id: "1", trip_id: "trip", start_date: {1970, 1, 2} ) @@ -91,6 +92,7 @@ defmodule Concentrate.GroupFilter.CancelledTripTest do test "does not cancel the group if all stop updates have already been given a skipped status but route_type is not 3" do td = TripDescriptor.new( + route_id: "Red", trip_id: "red_trip", start_date: {1970, 1, 2} ) @@ -113,6 +115,7 @@ defmodule Concentrate.GroupFilter.CancelledTripTest do test "does not cancel the group if only some stop updates have already been given a skipped schedule relationship" do td = TripDescriptor.new( + route_id: "86", trip_id: "trip", start_date: {1970, 1, 2} ) diff --git a/test/support/filter/fakes.ex b/test/support/filter/fakes.ex index d888ff23..4937dd7a 100644 --- a/test/support/filter/fakes.ex +++ b/test/support/filter/fakes.ex @@ -9,7 +9,13 @@ end defmodule Concentrate.GTFS.FakeRoutes do @moduledoc "Fake implementation of GTFS.Routes" - def route_type("trip"), do: 3 + def route_type(route_id) when is_binary(route_id) do + case Integer.parse(route_id) do + :error -> nil + _ -> 3 + end + end + def route_type(_), do: nil end