Skip to content

Commit

Permalink
[WiP] create GET /approles/:client_id test outline for #110
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Sep 12, 2020
1 parent 5b8d32e commit f09a184
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/auth_web/controllers/app_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,20 @@ defmodule AuthWeb.AppControllerTest do
end

describe "GET /approles/:client_id" do
setup [:create_app]

test "returns (JSON) list of roles", %{conn: conn, app: app} do
conn = admin_login(conn)
conn = get(conn, Routes.app_path(conn, :approles, app.apikey))
assert html_response(conn, 200) =~ "successfully reset"
key = List.first(app.apikeys)
IO.inspect(app, label: "app")
conn = conn
|> admin_login()
|> put_req_header("accept", "application/json")
|> get("/approles/#{key.client_id}")

assert conn.status == 200
{:ok, json} = Jason.decode(conn.resp_body)
IO.inspect(json)
# assert html_response(conn, 200) =~ "successfully reset"
end
end
end

0 comments on commit f09a184

Please sign in to comment.