Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. defmodule CatcastsWeb.AuthControllerTest do
  2. use CatcastsWeb.ConnCase
  3. alias Catcasts.Repo # add this line
  4. alias Catcasts.User # add this line
  5.  
  6. @ueberauth_auth %{credentials: %{token: "fdsnoafhnoofh08h38h"},
  7. info: %{email: "batman@example.com", first_name: "Bruce", last_name: "Wayne"},
  8. provider: :google}
  9.  
  10. ... # Code removed for readability
  11.  
  12. # Add the below test
  13. test "creates user from Google information", %{conn: conn} do
  14. conn = conn
  15. |> assign(:ueberauth_auth, @ueberauth_auth)
  16. |> get("/auth/google/callback")
  17.  
  18. users = User |> Repo.all
  19. assert Enum.count(users) == 1
  20. assert get_flash(conn, :info) == "Thank you for signing in!"
  21. end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement