Skip to content

Commit

Permalink
feedback: change function name
Browse files Browse the repository at this point in the history
  • Loading branch information
thecristen committed Sep 28, 2023
1 parent ea65c31 commit 2b04a40
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/site/lib/site_web/controllers/route_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ defmodule SiteWeb.RouteController do
use SiteWeb, :controller
alias Routes.{Repo, Route}

@spec get(Plug.Conn.t(), map) :: Plug.Conn.t()
def get(conn, %{"route_ids" => route_ids} = _params) do
@spec get_by_route_ids(Plug.Conn.t(), map) :: Plug.Conn.t()
def get_by_route_ids(conn, %{"route_ids" => route_ids} = _params) do
routes =
route_ids
|> String.split(",")
Expand Down
2 changes: 1 addition & 1 deletion apps/site/lib/site_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ defmodule SiteWeb.Router do
get("/stop/:id", StopController, :get)
get("/stop/:id/route-patterns", StopController, :grouped_route_patterns)
get("/map-config", MapConfigController, :get)
get("/routes/:route_ids", RouteController, :get)
get("/routes/:route_ids", RouteController, :get_by_route_ids)
get("/fares/one-way", FareController, :one_way_by_stop_id)
end

Expand Down
4 changes: 2 additions & 2 deletions apps/site/test/site_web/controllers/route_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ defmodule SiteWeb.RouteControllerTest do
import Mock
alias Routes.{Repo, Route}

describe "get/2" do
describe "get_by_route_ids/2" do
test "returns routes", %{conn: conn} do
with_mock Repo, get: fn id -> %Route{id: id} end do
conn = get(conn, route_path(conn, :get, "route_id1,route_id2"))
conn = get(conn, route_path(conn, :get_by_route_ids, "route_id1,route_id2"))
response = json_response(conn, 200)

assert [
Expand Down

0 comments on commit 2b04a40

Please sign in to comment.