-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(SiteWeb.StopController): don't show route patterns for services t…
…hat aren't running today (#1762) * feat(RoutePatterns.RoutePattern): add service_id and parse it from the trip's relationships * feat(V3Api.Services): get by ID * feat(Services.Repo): get by ID * feat(Services.Service): evaluate if a service runs on a date semi-adapted from the V3 API's approach * fix(StopController): remove some route patterns - remove route patterns associated to a service that is not running today - except when it's a canonical service... let that route pattern through anyway * hotfix(Services.Repo): handle errors * fix(Service): correct parsing to YYYY-MM-DD
- Loading branch information
1 parent
8cfc340
commit 3c2993d
Showing
8 changed files
with
179 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
defmodule V3Api.ServicesTest do | ||
use ExUnit.Case | ||
|
||
alias V3Api.Services | ||
|
||
@opts ["page[limit]": 1, sort: "id"] | ||
|
||
describe "all/1" do | ||
test "gets all services" do | ||
assert %JsonApi{data: [%JsonApi.Item{}]} = Services.all(@opts) | ||
end | ||
end | ||
|
||
describe "get/1" do | ||
test "gets the services by ID" do | ||
%JsonApi{data: [%JsonApi.Item{} = service]} = Services.get("canonical") | ||
assert service.id == "canonical" | ||
end | ||
end | ||
end |