Having the following email program preview code:
class RegistrationMailerPreview < ActionMailer::Preview
(full file).
That my settings ( users(:one) ) cannot be reached, return the error status 500 and print the following error:
NoMethodError: undefined method `users' for #RegistrationMailerPreview
Can we get instrument recordings from the mail view?
If so, I would like to know how to do it.
I saw that it should be possible here , but I cannot require test_helper in this file (I do not know why), and I do not understand the difference between ActionMailer::TestCase and ActionMailer::Preview .
If not, is there a way to view mail without sending as a User.first parameter, since I could run my tests on a machine that has no data populated in the database.
source share