Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement