Currently, PhoenixTest.visit/2 doesn't follow redirects. That's a helpful feature to have since (a) other links, buttons, etc. follow redirects (so it's expected), and (b) for scenarios like testing authentication in an app (imagine testing that you visit a page and you are redirected to a different page).
This commit adds redirection and tests it from both the Static and Live implementations -- even though the implementation is the same for both. It all happens in PhoenixTest.visit/2.
Closes #41
What changed?
Currently,
PhoenixTest.visit/2
doesn't follow redirects. That's a helpful feature to have since (a) other links, buttons, etc. follow redirects (so it's expected), and (b) for scenarios like testing authentication in an app (imagine testing that you visit a page and you are redirected to a different page).This commit adds redirection and tests it from both the Static and Live implementations -- even though the implementation is the same for both. It all happens in
PhoenixTest.visit/2
.