diff options
author | John Hawthorn <john@hawthorn.email> | 2019-03-01 14:07:59 -0800 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2019-03-01 14:07:59 -0800 |
commit | 4e6c8045c3c5f7b914040c3bbb2cbbd901f45854 (patch) | |
tree | 3d167db8ed291e90a8691597e35ac67b49ee16d1 /actionmailer/test/fixtures | |
parent | ed6364f7b6579a890c5cedc3c9e5b2f8af586e9e (diff) | |
download | rails-4e6c8045c3c5f7b914040c3bbb2cbbd901f45854.tar.gz rails-4e6c8045c3c5f7b914040c3bbb2cbbd901f45854.tar.bz2 rails-4e6c8045c3c5f7b914040c3bbb2cbbd901f45854.zip |
Add test and change how format set in ActionMailer
Previously this used self.formats= to set the format which render would
use to find templates. This worked, but was untested, and looked a
little confusing because it was doing the mutation within a loop.
This commit replaces the assignment with passing formats: [format] into
the render call, which makes it more obvious that that's the purpose of
the format. It also adds a test to verify the formats being used.
Diffstat (limited to 'actionmailer/test/fixtures')
-rw-r--r-- | actionmailer/test/fixtures/base_mailer/implicit_multipart_formats.html.erb | 1 | ||||
-rw-r--r-- | actionmailer/test/fixtures/base_mailer/implicit_multipart_formats.text.erb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/actionmailer/test/fixtures/base_mailer/implicit_multipart_formats.html.erb b/actionmailer/test/fixtures/base_mailer/implicit_multipart_formats.html.erb new file mode 100644 index 0000000000..0179b070b8 --- /dev/null +++ b/actionmailer/test/fixtures/base_mailer/implicit_multipart_formats.html.erb @@ -0,0 +1 @@ +Implicit Multipart <%= formats.inspect %>
\ No newline at end of file diff --git a/actionmailer/test/fixtures/base_mailer/implicit_multipart_formats.text.erb b/actionmailer/test/fixtures/base_mailer/implicit_multipart_formats.text.erb new file mode 100644 index 0000000000..0179b070b8 --- /dev/null +++ b/actionmailer/test/fixtures/base_mailer/implicit_multipart_formats.text.erb @@ -0,0 +1 @@ +Implicit Multipart <%= formats.inspect %>
\ No newline at end of file |