Our assert_has/3 and refute_has/3 helpers with "title" behave differently from the rest of our assertion helpers.
By default our other assertion helpers perform a match (=~) operation. Our "title" assertion performs an equality (==) operation.
In addition to being different from the rest, it's annoying because we typically render the title with a <.live_title> tag which has newlines and spaces.
We fix that in this commit and allow people to pass exact: true to match exactly.
Resolves https://github.com/germsvel/phoenix_test/issues/64
What changed?
Our
assert_has/3
andrefute_has/3
helpers with"title"
behave differently from the rest of our assertion helpers.By default our other assertion helpers perform a match (
=~
) operation. Our "title" assertion performs an equality (==
) operation.In addition to being different from the rest, it's annoying because we typically render the title with a
<.live_title>
tag which has newlines and spaces.We fix that in this commit and allow people to pass
exact: true
to match exactly.