プロジェクト

全般

プロフィール

Vote #66000

完了

Failing test in test_show_atom

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
-
対象バージョン:
開始日:
2009/11/12
期日:
進捗率:

100%

予定工数:
category_id:
0
version_id:
18
issue_org_id:
4204
author_id:
5
assigned_to_id:
5
comments:
6
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

(Pulling this out of the discussion from #3391)

I'm getting a failing test in the @test_show_atom(IssuesControllerTest)@ but it's not reproducible by others. Going to try to work on a patch here.


journals

Looks like an environment issue, since both the test and actual code are escaping quotes (@img src="...@):

<pre><code class="xml">
# Test
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title></title>
<link href="http://test.host/issues/2.atom" rel="self"/>
<link href="http://test.host/" rel="alternate"/>
<id>http://test.host/</id>
<updated>2009-11-10T00:00:00-08:00</updated>
<author>
<name>Redmine</name>
</author>
<entry>
<title>eCookbook - Feature request #2: Add ingredients categories</title>
<link href="http://test.host/issues/2" rel="alternate"/>
<id>http://test.host/issues/2?journal_id=3</id>
<updated>2009-11-10T00:00:00-08:00</updated>
<author>
<name>John Smith</name>
<email>jsmith@somenet.foo</email>
</author>
<content type="html">
&lt;ul&gt;&lt;/ul&gt;&lt;p&gt;A comment with inline image: &lt;img src=&quot;http://test.host/attachments/download/10&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; </content>
</entry>
</feed>
</code></pre>

Atom feed (displays the image properly):

<pre><code class="xml">
<entry>
<title>Digitized 24 hour firmware - Bug #398: Face to face fault-tolerant approach</title>
<link href="http://localhost:3000/issues/398" rel="alternate"/>
<id>http://localhost:3000/issues/398?journal_id=132</id>
<updated>2009-11-11T21:02:26-08:00</updated>
<author>
<name>Redmine Admin</name>
<email>edavis@littlestreamsoftware.com</email>
</author>
<content type="html">

&lt;ul&gt;&lt;li&gt;&lt;strong&gt;File&lt;/strong&gt; &lt;a href=&quot;/attachments/5/redmine-error.png&quot;&gt;redmine-error.png&lt;/a&gt; added&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Test &lt;img src=&quot;http://localhost:3000/attachments/download/5&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; </content>
</entry>

</code></pre>

--------------------------------------------------------------------------------
This might be from Builder. I'm running 2.1.2 which includes this:

> Version 2.0.0 introduces automatically escaped attribute values for the first time. Versions prior to 2.0.0 did not insert escape characters into attribute values in the XML markup. This allowed attribute values to explicitly reference entities, which was occasionally used by a small number of developers. Since strings could always be explicitly escaped by hand, this was not a major restriction in functionality.
>
> However, it did suprise most users of builder. Since the body text is normally escaped, everybody expected the attribute values to be escaped as well. Escaped attribute values were the number one support request on the 1.x Builder series.
>
>Starting with Builder version 2.0.0, all attribute values expressed as strings will be processed and the appropriate characters will be escaped (e.g. "&" will be tranlated to "&amp;"). Attribute values that are expressed as Symbol values will not be processed for escaped characters and will be unchanged in output. (Yes, this probably counts as Symbol abuse, but the convention is convenient and flexible).
>
> From: http://builder.rubyforge.org/

Running this by hand, the textilized attributes are escaped:

<pre>
>> xml = Builder::XmlMarkup.new
=> inspect
>> xml.text! textilizable(change, :notes, :only_path => false)
=> "<inspect/>&lt;p&gt;Test &lt;img src=&quot;http://localhost:3000/attachments/download/5&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;"
</pre>

I don't see any specific version of Builder required for Rails, so maybe we are running different versions which is causing the different output. Jean-Philippe, what version of builder do you have?
--------------------------------------------------------------------------------
I'm using builder 2.1.2 too.
--------------------------------------------------------------------------------
Double quotes are not escaped:

<pre>
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'builder'
=> true
irb(main):003:0> xml = Builder::XmlMarkup.new
=> <inspect/>
irb(main):004:0> xml.text! '<img src="foo.png" />'
=> "<inspect/>&lt;img src=\"foo.png\" /&gt;"
</pre>

Version:

<pre>
gem list --local builder

*** LOCAL GEMS ***

builder (2.1.2)
</pre>
--------------------------------------------------------------------------------
Jean-Philippe Lang:

I'm still getting this error and have been since I reported this. I've committed r3558 to try and use a different method of checking the atom response. Let me know if it doesn't work on your system.
--------------------------------------------------------------------------------
It seems to be OK. Merged in 0.9-stable.
--------------------------------------------------------------------------------


related_issues

relates,Closed,3391,When reading RSS feed, the inline-embedded images are not properly shown.

Admin Redmine さんがほぼ2年前に更新

  • 対象バージョン0.9.4_18 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0