Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cybrox/f880fbed1b03930f4949e449be18e8d8 to your computer and use it in GitHub Desktop.
Save cybrox/f880fbed1b03930f4949e449be18e8d8 to your computer and use it in GitHub Desktop.
Blog: Testing Protected Phoenix Controllers - Snippet 2
if @env == :test do
defp send_unauthorized_if_not_faked(conn) do
# Implement testing backdoor
conn
end
else
defp send_unauthorized_if_not_faked(conn) do
send_unauthorized_response(conn)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment