-
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
Getting emails from TestAdapter #233
Comments
@optikfluffel I think the best way to handle this might be to do a unit test on the email. That way you can do something like: assert email.html_body =~ the_generated_token Then in your integration tests you can use the new feature in #228 to test that the email with the correct subject is sent. Either that or use a fake token during test so it's always the same. Then you can use regular |
The unit test I already had ^^ Thanks :) FYI: To test my sign in mechanism, since it only checks if the |
I ran into a similar issue recently, I ended up doing the following to get the assert_receive({:delivered_email, %Bamboo.Email{} = email}, 100, Bamboo.Test.flunk_no_emails_received) |
Is there a way to get the emails sent through
Bamboo.TestAdapter
?I'm trying to test a passwordless
SessionController
in which I generate aPhoenix.Token
and send it out via email without storing it anywhere. It would be cool to be able to catch these emails and read the tokens to test the sign in mechanism.The text was updated successfully, but these errors were encountered: