-
Notifications
You must be signed in to change notification settings - Fork 23
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
CaseClauseError in assert_has
when multiple matches
#18
Comments
randycoulman
added a commit
to randycoulman/freedom_account
that referenced
this issue
Feb 10, 2024
Mostly works, but I've run into a couple of issues: - [`CaseClauseError` when multiple matches in `assert_has`](germsvel/phoenix_test#18) - [No obvious way to follow redirects after a form submition](germsvel/phoenix_test#19)
6 tasks
randycoulman
added a commit
to randycoulman/phoenix_test
that referenced
this issue
Feb 10, 2024
germsvel
pushed a commit
that referenced
this issue
Feb 10, 2024
Fixes #18 The docs for assert_has say "It'll raise an error if no elements are found, but it will not raise if more than one matching element is found." But I'm seeing that an assert_has with multiple matching elements is raising a CaseClauseError when it gets back a {:found_many, ...} tuple. This commit fixes that by adding the necessary clause.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The docs for assert_has say "It'll raise an error if no elements are found, but it will not raise if more than one matching element is found."
But I'm seeing that an
assert_has
with multiple matching elements is raising aCaseClauseError
when it gets back a{:found_many, ...}
tuple.If the docs are correct, it looks like it should be possible to add another clause to
Assertions.assert_has
. Probably something like:and a test case for this.
refute_has
does have a clause for{:found_many, ...}
, so no problems there.I'll work on a PR to address this.
The text was updated successfully, but these errors were encountered: