-
Notifications
You must be signed in to change notification settings - Fork 333
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 options with assert_delivered_email #74
Comments
@paulcsmith What do you mean by options ? This ? assert_delivered_email(subject: "Something") |
Yes exactly :) The feature did not work quite right so I believe I removed it, or at the very least removed docs so people didn't use it |
@paulcsmith Ok, I see. This would be backwards compatible as well, right ? Accepting an |
Yes that is correct. It should accept either of those two options |
I will open a pr regarding this :) |
@paulcsmith I have been digging through the code. If we use the Something like this: defmacro assert_delivered_email(email) do
quote do
import ExUnit.Assertions
email = Bamboo.Test.normalize_for_testing(unquote(email))
try do
assert_received({:delivered_email, ^email})
rescue
error in [ExUnit.AssertionError] ->
Bamboo.Test.flunk_with_email_list(email)
end
end
end What do you think of this ? |
@paulcsmith Up |
@jbernardo95 I think maybe another function should be added then. Something like Does that help/answer the question? |
@paulcsmith Kind of, what I was saying is that if we declare The other option we have is to put the Does that clarify ? |
I think making |
Yep it does ! Didn't know about hiding methods with |
@paulcsmith Here is a draft ^, take a look and tell me what you think :) |
@paulcsmith Up. |
Resolves #74. * Improves assert_delivered_email and adds assert_delivered_with * Adds documentation to assert_delivered_with/1 * Fixes typos and changes assert email timeout to 100ms
It should normalize the email addresses, and should only match against the keys that are in the options. For asserting just what you pass in, do something like this
The text was updated successfully, but these errors were encountered: