I have a auth error method like so.
def auth_error(conn, {type, _reason}, _opts) do
body = Poison.encode!(%{error: to_string(type)})
send_resp(conn, 401, body)
end
and I have a test like so
conn = get(conn, user_path(conn, :show))
assert json_response(conn, 401)["error"] == "unauthenticated"
And I get an error like so when I try and run my test.
** (RuntimeError) no content-type was set, expected a json response
code: assert json_response(conn, 401)["error"] == "unauthenticated"
What am I missing?