<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -541,7 +541,7 @@ describe TicketsController do
       @attachment = mock_model Attachment,
         :file_name =&gt; 'file.txt',
         :attachable =&gt; @ticket,
-        :textual? =&gt; true,
+        :plain? =&gt; true,
         :inline? =&gt; true,
         :readable? =&gt; true,
         :send_arguments =&gt; ['path', {}]</diff>
      <filename>spec/controllers/tickets_controller_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -73,18 +73,22 @@ class Attachment &lt; ActiveRecord::Base
     content_type.match(/^image\/(png|jpg|jpeg|gif)/i).present?
   end
 
-  def textual?
-    content_type.match(/^text/i).present?
+  def html?
+    content_type == Mime::HTML
+  end    
+
+  def plain?
+    !html? and content_type.starts_with?('text/')
   end    
 
   def inline?
-    textual? || image?
+    html? || plain? || image?
   end
   
   def send_arguments
     [physical_path, {
       :filename =&gt; file_name,
-      :type =&gt; textual? ? 'text/plain' : content_type,
+      :type =&gt; plain? ? 'text/plain' : content_type,
       :disposition =&gt; ( inline? ? 'inline' : 'attachment' )
     }]
   end</diff>
      <filename>vendor/plugins/has_attachment/lib/attachment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -91,10 +91,17 @@ describe Attachment do
         build_attachment('A').content_type.should == 'text/plain'
       end
 
-      it 'should identify textual content types' do
-        build_attachment('TEXT', 'file.txt', 'text/plain').should be_textual
-        build_attachment('GIF89', 'file.gif', 'image/gif').should_not be_textual
-        build_attachment('PDF', 'file.pdf', 'application/pdf').should_not be_textual
+      it 'should identify html content types' do
+        build_attachment('TEXT', 'file.txt', 'text/plain').should_not be_html
+        build_attachment('HTML', 'file.html', 'text/html').should be_html
+      end
+
+      it 'should identify plain textual content types' do
+        build_attachment('TEXT', 'file.txt', 'text/plain').should be_plain
+        build_attachment('CSV', 'file.csv', 'text/csv').should be_plain
+        build_attachment('HTML', 'file.html', 'text/html').should_not be_plain
+        build_attachment('GIF89', 'file.gif', 'image/gif').should_not be_plain
+        build_attachment('PDF', 'file.pdf', 'application/pdf').should_not be_plain
       end
 
       it 'should identify image content types' do</diff>
      <filename>vendor/plugins/has_attachment/spec/attachment_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>55924800f09052516ab8f499faa3fe676d853671</id>
    </parent>
  </parents>
  <author>
    <name>Dimitrij Denissenko</name>
    <email>contact@dvisionfactory.com</email>
  </author>
  <url>http://github.com/dim/retrospectiva/commit/16eef7816ca297cb78b8163ee0fb9bbd63d3c93f</url>
  <id>16eef7816ca297cb78b8163ee0fb9bbd63d3c93f</id>
  <committed-date>2009-10-27T00:57:40-07:00</committed-date>
  <authored-date>2009-10-27T00:57:40-07:00</authored-date>
  <message>Don't convert HTML attachments to plain text</message>
  <tree>f2d6b94e203eb7fa30e89cd90894b949d6a0b7a4</tree>
  <committer>
    <name>Dimitrij Denissenko</name>
    <email>contact@dvisionfactory.com</email>
  </committer>
</commit>
