We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
The following shows how to test protected resources.
defmodule MyApp.PostControllerTest do use MyApp.ConnCase setup %{conn: conn} do user = User.changeset(%User{}, %{name: "test", email: "[email protected]", password: "test", password_confirmation: "test"}) |> Repo.insert! {:ok, conn: assign(conn, :current_user, user), user: user} end test "lists all entries on index", %{conn: conn} do conn = get conn, post_path(conn, :index) assert html_response(conn, 200) =~ "Listing posts" end end