Hey, so in some cases we might redirect but not know the exact path upfront, for example let's say that we create a new post and than we expect to get redirected to that post. That might look something like:
conn
|> login_user(user)
|> visit("/app/posts/new")
|> fill_in("Title", with: "Some")
|> fill_in("Content", with: "Post")
|> click_button("Create")
|> assert_path(~r"/app/posts/.+/show")
Right now this will fail as Regex is not supported. A workaround currently is to use then
...
|> click_button("Create ")
|> then(fn conn ->
current_path = PhoenixTest.Driver.current_path(conn)
assert current_path =~ ~r"/app/posts/.+/show"
conn
end)
But the former makes for cleaner code.
Would we want to support this?
Hey, so in some cases we might redirect but not know the exact path upfront, for example let's say that we create a new post and than we expect to get redirected to that post. That might look something like:
Right now this will fail as Regex is not supported. A workaround currently is to use
thenBut the former makes for cleaner code.
Would we want to support this?