Changeset 8238
- Timestamp:
- 11/29/07 02:52:49 (1 year ago)
- Files:
-
- trunk/actionmailer/lib/action_mailer/part.rb (modified) (1 diff)
- trunk/actionmailer/test/mail_service_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionmailer/lib/action_mailer/part.rb
r3959 r8238 85 85 else 86 86 if String === body 87 part = TMail::Mail.new 88 part.body = body 89 part.set_content_type(real_content_type, nil, ctype_attrs) 90 part.set_content_disposition "inline" 91 m.parts << part 87 @parts.unshift Part.new(:charset => charset, :body => @body, :content_type => 'text/plain') 88 @body = nil 92 89 end 93 90 trunk/actionmailer/test/mail_service_test.rb
r8111 r8238 211 211 end 212 212 213 def nested_multipart_with_body(recipient) 214 recipients recipient 215 subject "nested multipart with body" 216 from "test@example.com" 217 content_type "multipart/mixed" 218 part :content_type => "multipart/alternative", :content_disposition => "inline", :body => "Nothing to see here." do |p| 219 p.part :content_type => "text/html", :body => "<b>test</b> HTML<br/>" 220 end 221 end 222 213 223 def attachment_with_custom_header(recipient) 214 224 recipients recipient … … 309 319 assert_equal "text/html", created.parts.first.parts[1].content_type 310 320 assert_equal "application/octet-stream", created.parts[1].content_type 321 end 322 323 def test_nested_parts_with_body 324 created = nil 325 assert_nothing_raised { created = TestMailer.create_nested_multipart_with_body(@recipient)} 326 assert_equal 1,created.parts.size 327 assert_equal 2,created.parts.first.parts.size 328 329 assert_equal "multipart/mixed", created.content_type 330 assert_equal "multipart/alternative", created.parts.first.content_type 331 assert_equal "Nothing to see here.", created.parts.first.parts.first.body 332 assert_equal "text/plain", created.parts.first.parts.first.content_type 333 assert_equal "text/html", created.parts.first.parts[1].content_type 311 334 end 312 335