germsvel / phoenix_test

PhoenixTest provides a unified way of writing feature tests -- regardless of whether you're testing LiveView pages or static (non-LiveView) pages.
https://hex.pm/packages/phoenix_test
MIT License
170 stars 22 forks source link

Add `PhoenixTest.assert_path` and `refute_path` #60

Closed germsvel closed 6 months ago

germsvel commented 6 months ago

Resolves https://github.com/germsvel/phoenix_test/issues/32

What changed?

We add two new assertion helpers to assert on the current path: assert_path and refute_path. Both helpers have a 2 and 3 arity versions. The 3-arity version takes a query_params key to assert on the query params.

We do not handle other optional arguments (such as host or scheme), though we could see this being extensible in the future with those options.