test/test_message.rb in padrino-mailer-0.13.0.beta3 vs test/test_message.rb in padrino-mailer-0.13.0
- old
+ new
@@ -150,7 +150,20 @@
assert_equal 'Hello there Padrino', message.subject
assert_equal 'plain text', message.body.to_s.chomp
message.encoded
assert_equal :plain, message.content_type
end
+
+ it 'should render partials' do
+ objects = [1,2,'<evil>','<good>'.html_safe]
+ message = Mail::Message.new do
+ from 'padrino@me.com'
+ to 'padrino@you.com'
+ subject 'Hello there Padrino'
+ views File.dirname(__FILE__) + '/fixtures/views/mailers'
+ partial 'partial/object', :collection => objects
+ end
+
+ assert_equal "Object 1<br>\nObject 2<br>\nObject <evil><br>\nObject <good><br>", message.body.to_s.chomp
+ end
end
end