I am trying to create a test wherein after a post method I will redirect the user with query params associated with it
# controller.ex
def function(conn, params) do
...
conn
|> redirect(to: <path + id: id, name: name> )
end
# controller_test.exs
conn = post(conn, Routes.path(conn, :function), params)
# %{id: id, name: name} = redirected_params(conn) -> error
# %{id: id, name: name} = conn.query_params -> error
but when I look at the returned connection from the test, it seems that the query_params and query_strings are empty.
what is the way to get the query_params/query_strings generated from the controller to controller_test?