instance method
read_fixture
Ruby on Rails 7.2.3
Since v3.2.22.5Signature
read_fixture(action)
Reads the fixture file for the given mailer.
This is useful when testing mailers by being able to write the body of an email inside a fixture. See the testing guide for a concrete example: guides.rubyonrails.org/testing.html#revenge-of-the-fixtures
Parameters
-
actionreq
Source
# File actionmailer/lib/action_mailer/test_case.rb, line 82
def read_fixture(action)
IO.readlines(File.join(Rails.root, "test", "fixtures", self.class.mailer_class.name.underscore, action))
end
Defined in actionmailer/lib/action_mailer/test_case.rb line 82
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionMailer::TestCase::Behavior