]> source.dussan.org Git - redmine.git/commitdiff
FIxed: inline images not displayed in atom feeds (#3391).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 26 May 2009 08:28:36 +0000 (08:28 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 26 May 2009 08:28:36 +0000 (08:28 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2768 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/common/feed.atom.rxml
app/views/issues/changes.rxml
test/fixtures/attachments.yml
test/fixtures/journals.yml
test/functional/issues_controller_test.rb

index 688d1d27a7e6ceaa809ef610549e811c436b9a0e..70dacc75a15d68e1a636f94b93f3ca529c2bca64 100644 (file)
@@ -24,7 +24,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
         xml.email(author.mail) if author.is_a?(User) && !author.mail.blank? && !author.pref.hide_mail
       end if author
       xml.content "type" => "html" do
-        xml.text! textilizable(item.event_description, :only_path => false)
+        xml.text! textilizable(item, :event_description, :only_path => false)
       end
     end
   end
index 43324cfb8b9ae4113384df5060c25a65d4d958e0..4c1e678bf3993d4713b9bb7d958442f2d81ea760 100644 (file)
@@ -23,7 +23,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
           xml.text! '<li>' + show_detail(detail, false) + '</li>'
         end
         xml.text! '</ul>'
-        xml.text! textilizable(change.notes) unless change.notes.blank?
+        xml.text! textilizable(change, :notes, :only_path => false) unless change.notes.blank?
       end
     end
   end
index 2497bd9a3c74063503d28e396e6559b4237dc753..94c118f9e28ae60e91183de9b8793837f51b5cd1 100644 (file)
@@ -109,4 +109,16 @@ attachments_009:
   filename: version_file.zip\r
   author_id: 2\r
   content_type: application/octet-stream\r
+attachments_010: \r
+  created_on: 2006-07-19 21:07:27 +02:00\r
+  container_type: Issue\r
+  container_id: 2\r
+  downloads: 0\r
+  disk_filename: 060719210727_picture.jpg\r
+  digest: b91e08d0cf966d5c6ff411bd8c4cc3a2\r
+  id: 10\r
+  filesize: 452\r
+  filename: picture.jpg\r
+  author_id: 2\r
+  content_type: image/jpeg\r
   
\ No newline at end of file
index 70aa5da73fcc6a9d125cb6178c60201f7b47a5d3..3ee66ae6b4106f1c1dedb7d73f599ca2c955d262 100644 (file)
@@ -13,4 +13,11 @@ journals_002:
   journalized_type: Issue\r
   user_id: 2\r
   journalized_id: 1\r
+journals_003: \r
+  created_on: <%= 1.days.ago.to_date.to_s(:db) %>\r
+  notes: "A comment with inline image: !picture.jpg!"\r
+  id: 3\r
+  journalized_type: Issue\r
+  user_id: 2\r
+  journalized_id: 2\r
   
\ No newline at end of file
index ff132669d778761a492c79b3d3ad85e092835fa4..4b5c2d34344e3bbf9ec0bde923b2df1837064513 100644 (file)
@@ -369,6 +369,14 @@ class IssuesControllerTest < Test::Unit::TestCase
                         :descendant => { :tag => 'a', :content => /#4$/ }
   end
   
+  def test_show_atom
+    get :show, :id => 2, :format => 'atom'
+    assert_response :success
+    assert_template 'changes.rxml'
+    # Inline image
+    assert @response.body.include?("&lt;img src=\"http://test.host/attachments/download/10\" alt=\"\" /&gt;")
+  end
+  
   def test_new_routing
     assert_routing(
       {:method => :get, :path => '/projects/1/issues/new'},