Testing Mailable::build with Mail fake #33144
Unanswered
SteenSchutt
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm not sure if this is a feature request or not, but when I use Mail::fake() in a test, and then assert that an e-mail is queued, it doesn't seem that build() is called on my Mailable. It doesn't really make sense to me, that errors in my blade template (e.g. variables not passed to the view) are not caught by the test. They immediately appear if I send the request manually.
Is this just because I'm using ShouldQueue, or is it simply a deficiency in the mail fake? Would it make sense to actually build the mailable, even if just to discard the output afterwards?
Beta Was this translation helpful? Give feedback.
All reactions