From 7c15d58e7e152dd5040685dc650ff34a4ee3c662 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Wed, 11 Feb 2009 17:06:20 +1300 Subject: [PATCH] Show that render_message does in fact work --- actionmailer/test/mail_render_test.rb | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/actionmailer/test/mail_render_test.rb b/actionmailer/test/mail_render_test.rb index 4581161..c9edae2 100644 --- a/actionmailer/test/mail_render_test.rb +++ b/actionmailer/test/mail_render_test.rb @@ -33,6 +33,18 @@ class RenderMailer < ActionMailer::Base from "tester@example.com" body render(:inline => "Hello, <%= render \"subtemplate\" %>", :body => { :world => "Earth" }) end + + def file_template_with_attachment(recipient) + recipients recipient + subject "attaching_files" + from "tester@example.com" + content_type "multipart/alternative" + + part :content_type => "text/plain", + :body => render_message("signed_up", :recipient => recipient) + part :content_type => "text/csv", + :body => "1,2,3" + end def initialize_defaults(method_name) super @@ -79,6 +91,12 @@ class RenderHelperTest < Test::Unit::TestCase assert_equal "Hello there, \n\nMr. test@localhost", mail.body.strip end + def test_file_template_with_attachment + mail = RenderMailer.create_file_template_with_attachment(@recipient) + assert_equal "Hello there, \n\nMr. test@localhost1,2,3", mail.body.strip + end + + def test_rxml_template mail = RenderMailer.deliver_rxml_template(@recipient) assert_equal "\n", mail.body.strip -- 1.6.0.1