<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/fixtures/html_multipart.txt</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -283,8 +283,13 @@ module Astrotrain
         @body = @body.join(&quot;\n&quot;)
         @html = @html.join(&quot;\n&quot;)
       else
-        @body = @mail.body
-        @html = ''
+        if @mail.content_type == 'text/html'
+          @html = @mail.body
+          @body = ''
+        else
+          @body = @mail.body
+          @html = ''
+        end
       end
       if !@mail.charset
         @body = convert_to_utf8(@body)</diff>
      <filename>lib/astrotrain/message.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,13 +4,7 @@ To: xyz@astrotrain.com
 Message-ID: &lt;11644553.1741252281981737.JavaMail.root@astrotrain&gt;
 Subject: ABC DEF
 MIME-Version: 1.0
-Content-Type: multipart/mixed; 
-    boundary=&quot;----=_Part_1695_189596019.1252281981305&quot;
-X-Mailer: Railo Mail
-
-------=_Part_1695_189596019.1252281981305
 Content-Type: text/html; charset=UTF-8
 Content-Transfer-Encoding: quoted-printable
 
-&lt;p&gt;ABC&lt;/p&gt;
-------=_Part_1695_189596019.1252281981305--
\ No newline at end of file
+&lt;p&gt;ABC&lt;/p&gt;
\ No newline at end of file</diff>
      <filename>test/fixtures/html.txt</filename>
    </modified>
    <modified>
      <diff>@@ -387,6 +387,21 @@ class Astrotrain::MessageTest &lt; Astrotrain::TestCase
       end
     end
 
+    describe &quot;with only HTML body in a multipart message&quot; do
+      before :all do
+        @raw     = mail(:html_multipart)
+        @message = Astrotrain::Message.parse(@raw)
+      end
+
+      it &quot;parses emtpy body&quot; do
+        assert_equal '', @message.body
+      end
+
+      it &quot;parses HTML body&quot; do
+        assert_equal &quot;&lt;p&gt;ABC&lt;/p&gt;\n------&quot;, @message.html
+      end
+    end
+
     describe &quot;with only HTML body&quot; do
       before :all do
         @raw     = mail(:html)
@@ -398,7 +413,7 @@ class Astrotrain::MessageTest &lt; Astrotrain::TestCase
       end
 
       it &quot;parses HTML body&quot; do
-        assert_equal &quot;&lt;p&gt;ABC&lt;/p&gt;\n------&quot;, @message.html
+        assert_equal &quot;&lt;p&gt;ABC&lt;/p&gt;&quot;, @message.html
       end
     end
 </diff>
      <filename>test/message_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7def86f570f9bfde55aa1047f9ac9d8604cfe45b</id>
    </parent>
  </parents>
  <author>
    <name>rick</name>
    <email>technoweenie@gmail.com</email>
  </author>
  <url>http://github.com/entp/astrotrain/commit/e29c7bb38964e578196d8aada0b45a3b5e6a9b15</url>
  <id>e29c7bb38964e578196d8aada0b45a3b5e6a9b15</id>
  <committed-date>2009-11-05T12:31:50-08:00</committed-date>
  <authored-date>2009-11-05T12:31:50-08:00</authored-date>
  <message>support html bodies in single part emails</message>
  <tree>eb5dab905e4d43aba022dd63e3e976be4f487c62</tree>
  <committer>
    <name>rick</name>
    <email>technoweenie@gmail.com</email>
  </committer>
</commit>
