PhoenixIntegration.Requests.follow_fn
You're seeing just the function
follow_fn
, go back to PhoenixIntegration.Requests module for more information.
Calls a function and follows the any redirects in the returned conn
.
If the function returns anything other than a conn
, then the result is ignored
and follow_fn
will simply return the original conn
This gives a way to insert custom assertions, or other setup code without breaking the piped chain of functions.
Parameters
conn
A conn that has been set up to work in the test environment. Could be the conn originally passed in to the test;func
a function in the form offn(conn) -> end
;opts
A map of additional options:max_redirects
- Maximum number of redirects to follow. Defaults to5
;
Example:
follow_fn( conn, fn(c) ->
"/some_path/" <> token = c.request_path
assert token == "valid_token"
end)