Skip to content

Instantly share code, notes, and snippets.

@nel
Created March 3, 2010 02:13
Show Gist options
  • Save nel/320229 to your computer and use it in GitHub Desktop.
Save nel/320229 to your computer and use it in GitHub Desktop.
it "should detect text_part and remain consistent" do
m = Mail.new(:content_type => 'mixed/multipart')
p = Mail::Part.new(:content_type => 'mixed/alternative')
p.add_part(Mail::Part.new(:content_type => 'text/html', :body => 'HTML TEXT'))
p.add_part(Mail::Part.new(:content_type => 'text/plain', :body => 'PLAIN TEXT'))
a = Mail::Part.new(:content_type => 'text/plain', :body => 'signature')
m.add_part(p)
m.add_part(a)
m.text_part.body.decoded.should == 'PLAIN TEXT'
m.to_s
m.text_part.body.decoded.should == 'PLAIN TEXT' #fail is "signature"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment