Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bfauble committed Sep 19, 2024
1 parent 5052c02 commit 299ddf3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/concentrate/group_filter/cancelled_trip_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
Expand All @@ -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}
)
Expand All @@ -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}
)
Expand Down
8 changes: 7 additions & 1 deletion test/support/filter/fakes.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 299ddf3

Please sign in to comment.