Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix assert_has/refute_has title matching exactly #65

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

germsvel
Copy link
Owner

Resolves #64

What changed?

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.

What changed?
============

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.
@germsvel germsvel merged commit 7b2f243 into main Apr 15, 2024
2 checks passed
@germsvel germsvel deleted the fix-title-matching branch April 15, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assert_has/3 on page title does exact matching by default
1 participant