Last active
March 26, 2018 15:38
-
-
Save thebrianemory/62f4ade122f5c3408d542af0727bf967 to your computer and use it in GitHub Desktop.
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
defmodule CatcastsWeb.AuthControllerTest do | |
use CatcastsWeb.ConnCase | |
alias Catcasts.Repo # add this line | |
alias Catcasts.User # add this line | |
@ueberauth_auth %{credentials: %{token: "fdsnoafhnoofh08h38h"}, | |
info: %{email: "batman@example.com", first_name: "Bruce", last_name: "Wayne"}, | |
provider: :google} | |
... # Code removed for readability | |
# Add the below test | |
test "creates user from Google information", %{conn: conn} do | |
conn = conn | |
|> assign(:ueberauth_auth, @ueberauth_auth) | |
|> get("/auth/google/callback") | |
users = User |> Repo.all | |
assert Enum.count(users) == 1 | |
assert get_flash(conn, :info) == "Thank you for signing in!" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment