Skip to content

Instantly share code, notes, and snippets.

@ruevaughn
Created January 11, 2017 04:57
Show Gist options
  • Save ruevaughn/5172da009bf971993d6ad1dd03690ce0 to your computer and use it in GitHub Desktop.
Save ruevaughn/5172da009bf971993d6ad1dd03690ce0 to your computer and use it in GitHub Desktop.
test "requires user authentication on all actions", %{conn: conn} do
Enum.each([
get(conn, video_path(conn, :new)),
get(conn, video_path(conn, :index)),
get(conn, video_path(conn, :show, "123")),
get(conn, video_path(conn, :edit, "123")),
put(conn, video_path(conn, :update, "123", %{})),
post(conn, video_path(conn, :create, %{})),
delete(conn, video_path(conn, :delete, "123")),
], fn conn ->
assert html_response(conn, 302)
assert conn.halted
end)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment