I accidentally broke the user_return_to implementation and I was not able to find this mistake for a couple weeks, so I suggest adding this controller test to help avoid others accidentally breaking it too:
# user_session_controller_test
test "logs the user in with return to", %{conn: conn, user: user} do
conn =
conn
|> init_test_session(user_return_to: "/foo/bar")
|> post(Routes.user_session_path(conn, :create), %{
"user" => %{
"email" => user.email,
"password" => valid_user_password(),
"remember_me" => "true"
}
})
assert redirected_to(conn) == "/foo/bar"
end
I accidentally broke the user_return_to implementation and I was not able to find this mistake for a couple weeks, so I suggest adding this controller test to help avoid others accidentally breaking it too: