Skip to content

Commit

Permalink
client_id > auth_client_id (tests) #57
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Apr 29, 2020
1 parent 333ae6c commit 4257656
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/auth_web/controllers/auth_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule AuthWeb.AuthControllerTest do
test "google_handler/2 for google auth callback", %{conn: conn} do
conn = get(conn, "/auth/google/callback",
%{code: "234", state: "http://localhost:4000" <>
"&client_id=" <> AuthPlug.Token.client_id() })
"&auth_client_id=" <> AuthPlug.Token.client_id() })

# assert html_response(conn, 200) =~ "[email protected]"
assert html_response(conn, 302) =~ "http://localhost"
Expand All @@ -30,7 +30,7 @@ defmodule AuthWeb.AuthControllerTest do
conn = get(conn, "/auth/google/callback",
%{code: "234",
state: AuthPlug.Helpers.get_baseurl_from_conn(conn) <>
"&client_id=" <> key.client_id })
"&auth_client_id=" <> key.client_id })

# assert html_response(conn, 200) =~ "[email protected]"
assert html_response(conn, 302) =~ "redirected"
Expand All @@ -56,7 +56,7 @@ defmodule AuthWeb.AuthControllerTest do
invalid_key = String.slice(AuthPlug.Token.client_id(), 0..-2)
conn = get(conn, "/auth/google/callback",
%{code: "234", state: "www.example.com/" <>
"&client_id=" <> invalid_key })
"&auth_client_id=" <> invalid_key })
# assert html_response(conn, 200) =~ "google account"
assert html_response(conn, 401) =~ "invalid"
end
Expand Down

0 comments on commit 4257656

Please sign in to comment.