Closed PJUllrich closed 1 month ago
https://github.com/swoosh/swoosh/issues/797#issuecomment-1662993654 Try the experimental one?
Or Jose's simpler one https://github.com/swoosh/swoosh/issues/488#issuecomment-1671224765
@princemaple I can confirm that the experimental version of refute_email_sent
works!
So, now I can do:
import Swoosh.X.TestAssertions
test "foo", %{user: user} do
refute_email_sent(to: user.email, subject: "Some email")
end
Thanks. Probably time for me to open an issue to settle on the new version.
Describe the bug
I try to assert that an email was sent to a user's email address, but refute that another email was sent as well.
My code looks something like this:
When I run the test, I receive an error like this:
The problem seems to be that I cannot give a variable
user.email
asto:
-option to therefute_email_sent/1
function, but I can it works just fine for theassert_email_sent/1
function.I also tried pinning the
^user.email
and to assign the email to a temporary variable like^user_email
, but neither worked.Steps to Reproduce the Bug or Issue
Create a test like the above and run it.
Expected behavior
I'd expect both function
assert_email_sent/1
andrefute_email_sent/1
to accept the same attributes.Your reproducible example
No response
Screenshots or Videos
No response
Platform
elixir 1.15.7-otp-26 erlang 26.1.2 swoosh 1.11.5
Additional context
No response