Open michaeljones opened 4 years ago
Thanks for opening the issue. I will have another look at the bamboo docs and get back to you soon.
Yes, you are right. It looks like the design of Bamboo encourages separating the email generation from sending.
I will make the changes to the example app first, and then I will update the installer.
First, sorry for the delay in responding to this issue.
Second, this repository is no longer actively maintained. I just do not have the time or energy needed to continue maintaining it.
No trouble at all. I understand what it is to stop having time or motivation for an open source project. Always good to draw a line in the sand and move on. I suspect the new semi-official Phoenix Auth stuff has probably reduced the need or focus on this too. All the best!
I've been struggling a bit today as my tests indicated that I was sending an email when I thought the logic being called isn't sending any. But I was overlooking the fact that the
confirm_request
and other methods in theEmail
module callMailer.deliver_later
directly.From the bamboo docs, it seems like typical email test code might look like:
In order to test that the
premium_signup_path
generates and sends aconfirm_request
email.However this always passes no matter what the logic in the controller trigger by
Routes.premium_signup_path(conn, :create)
is becauseexpected_email = Email.confirm_request(email, link)
sends an email itself.It might be worth adjusting the approach so that it is possible to ask the Email module to generate an email without sending it so that tests like the above can be done. I've taken to calling
Mailer.deliver_later
at the various call sites but maybe there could be separateconfirm_request
andsend_confirm_request
methods in the Email module or something like that.Edit: I'm very appreciative of the work you've put into this project. It has helped me to get started much more confidently with Elixir & Phoenix. It also seems like you're quite busy these days. I don't feel like this is super pressing or anything.
If you have a preferred way forward, I could attempt to make a pull request if that would be useful. Or we can leave it as it is.