Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
TakutoYoshimura committed Jun 5, 2019
1 parent e64c8c9 commit 77f1995
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/materia_web/controllers/authenticator_conrtoller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -208,22 +208,22 @@ defmodule MateriaWeb.AuthenticatorControllerTest do

describe "application authentication pattern" do
test "valid case app_key in params", %{conn: conn} do
conn = get(conn, "/app/is_authenticated_app", [app_key: "test_app_key"])
resp = response(conn, 200)
get_conn = get(conn, "/app/is_authenticated_app", [app_key: "test_app_key"])
resp = response(get_conn, 200)
assert resp == "{\"message\":\"authenticated\"}"
end

test "invalid case app_key in params", %{conn: conn} do
conn = get(conn, "/app/is_authenticated_app", [app_key: "hogehoge"])
resp = response(conn, 401)
get_conn = get(conn, "/app/is_authenticated_app", [app_key: "hogehoge"])
resp = response(get_conn, 401)
assert resp == "{\"message\":\"invalid_token\"}"
end

test "valid case app_key in req_header", %{conn: conn} do
puted_conn = conn
|> put_req_header("authorization", "test_app_key")
conn = get(puted_conn, "/app/is_authenticated_app")
resp = response(conn, 200)
get_conn = get(puted_conn, "/app/is_authenticated_app")
resp = response(get_conn, 200)
assert resp == "{\"message\":\"authenticated\"}"
end

Expand Down

0 comments on commit 77f1995

Please sign in to comment.