I have a pretty simple code in the phoenix controller. It does some stuff and returns content depending on the format:
def delete(conn, _params) do
# some stuff here
if get_format(conn) == "json" do
conn |> put_status(200) |> json(%{})
else
conn |> redirect(to: "/")
end
end
It works properly, but I have a problem with testing it. I can't test html return. How can I do it? dispatch/5 doesn't have anything related to format.