https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292009-11-12T05:00:41ZRedmineRedmine - Defect #4204: Failing test in test_show_atomhttps://www.redmine.org/issues/4204?journal_id=120112009-11-12T05:00:41ZEric Davis
<ul></ul><p>Looks like an environment issue, since both the test and actual code are escaping quotes (<code>img src="...</code>):</p>
<pre><code class="xml syntaxhl"># Test
<span class="cp"><?xml version="1.0" encoding="UTF-8"?></span>
<span class="nt"><feed</span> <span class="na">xmlns=</span><span class="s">"http://www.w3.org/2005/Atom"</span><span class="nt">></span>
<span class="nt"><title></title></span>
<span class="nt"><link</span> <span class="na">href=</span><span class="s">"http://test.host/issues/2.atom"</span> <span class="na">rel=</span><span class="s">"self"</span><span class="nt">/></span>
<span class="nt"><link</span> <span class="na">href=</span><span class="s">"http://test.host/"</span> <span class="na">rel=</span><span class="s">"alternate"</span><span class="nt">/></span>
<span class="nt"><id></span>http://test.host/<span class="nt"></id></span>
<span class="nt"><updated></span>2009-11-10T00:00:00-08:00<span class="nt"></updated></span>
<span class="nt"><author></span>
<span class="nt"><name></span>Redmine<span class="nt"></name></span>
<span class="nt"></author></span>
<span class="nt"><entry></span>
<span class="nt"><title></span>eCookbook - Feature request #2: Add ingredients categories<span class="nt"></title></span>
<span class="nt"><link</span> <span class="na">href=</span><span class="s">"http://test.host/issues/2"</span> <span class="na">rel=</span><span class="s">"alternate"</span><span class="nt">/></span>
<span class="nt"><id></span>http://test.host/issues/2?journal_id=3<span class="nt"></id></span>
<span class="nt"><updated></span>2009-11-10T00:00:00-08:00<span class="nt"></updated></span>
<span class="nt"><author></span>
<span class="nt"><name></span>John Smith<span class="nt"></name></span>
<span class="nt"><email></span>jsmith@somenet.foo<span class="nt"></email></span>
<span class="nt"></author></span>
<span class="nt"><content</span> <span class="na">type=</span><span class="s">"html"</span><span class="nt">></span>
<span class="ni">&lt;</span>ul<span class="ni">&gt;&lt;</span>/ul<span class="ni">&gt;&lt;</span>p<span class="ni">&gt;</span>A comment with inline image: <span class="ni">&lt;</span>img src=<span class="ni">&quot;</span>http://test.host/attachments/download/10<span class="ni">&quot;</span> alt=<span class="ni">&quot;&quot;</span> /<span class="ni">&gt;&lt;</span>/p<span class="ni">&gt;</span> <span class="nt"></content></span>
<span class="nt"></entry></span>
<span class="nt"></feed></span>
</code></pre>
<p>Atom feed (displays the image properly):</p>
<pre><code class="xml syntaxhl"> <span class="nt"><entry></span>
<span class="nt"><title></span>Digitized 24 hour firmware - Bug #398: Face to face fault-tolerant approach<span class="nt"></title></span>
<span class="nt"><link</span> <span class="na">href=</span><span class="s">"http://localhost:3000/issues/398"</span> <span class="na">rel=</span><span class="s">"alternate"</span><span class="nt">/></span>
<span class="nt"><id></span>http://localhost:3000/issues/398?journal_id=132<span class="nt"></id></span>
<span class="nt"><updated></span>2009-11-11T21:02:26-08:00<span class="nt"></updated></span>
<span class="nt"><author></span>
<span class="nt"><name></span>Redmine Admin<span class="nt"></name></span>
<span class="nt"><email></span>edavis@littlestreamsoftware.com<span class="nt"></email></span>
<span class="nt"></author></span>
<span class="nt"><content</span> <span class="na">type=</span><span class="s">"html"</span><span class="nt">></span>
<span class="ni">&lt;</span>ul<span class="ni">&gt;&lt;</span>li<span class="ni">&gt;&lt;</span>strong<span class="ni">&gt;</span>File<span class="ni">&lt;</span>/strong<span class="ni">&gt;</span> <span class="ni">&lt;</span>a href=<span class="ni">&quot;</span>/attachments/5/redmine-error.png<span class="ni">&quot;&gt;</span>redmine-error.png<span class="ni">&lt;</span>/a<span class="ni">&gt;</span> added<span class="ni">&lt;</span>/li<span class="ni">&gt;&lt;</span>/ul<span class="ni">&gt;&lt;</span>p<span class="ni">&gt;</span>Test <span class="ni">&lt;</span>img src=<span class="ni">&quot;</span>http://localhost:3000/attachments/download/5<span class="ni">&quot;</span> alt=<span class="ni">&quot;&quot;</span> /<span class="ni">&gt;&lt;</span>/p<span class="ni">&gt;</span> <span class="nt"></content></span>
<span class="nt"></entry></span>
</code></pre> Redmine - Defect #4204: Failing test in test_show_atomhttps://www.redmine.org/issues/4204?journal_id=120122009-11-12T05:13:11ZEric Davis
<ul></ul><p>This might be from Builder. I'm running 2.1.2 which includes this:</p>
<blockquote>
<p>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.</p>
<p>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.</p>
<p>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 "&"). 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).</p>
<p>From: <a class="external" href="http://builder.rubyforge.org/">http://builder.rubyforge.org/</a></p>
</blockquote>
<p>Running this by hand, the textilized attributes are escaped:</p>
<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>
<p>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?</p> Redmine - Defect #4204: Failing test in test_show_atomhttps://www.redmine.org/issues/4204?journal_id=120342009-11-12T21:48:47ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>I'm using builder 2.1.2 too.</p> Redmine - Defect #4204: Failing test in test_show_atomhttps://www.redmine.org/issues/4204?journal_id=120352009-11-12T21:58:35ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Double quotes are not escaped:</p>
<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>
<p>Version:</p>
<pre>
gem list --local builder
*** LOCAL GEMS ***
builder (2.1.2)
</pre> Redmine - Defect #4204: Failing test in test_show_atomhttps://www.redmine.org/issues/4204?journal_id=150202010-03-10T05:39:54ZEric Davis
<ul><li><strong>Status</strong> changed from <i>7</i> to <i>Resolved</i></li><li><strong>Target version</strong> set to <i>0.9.4</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Jean-Philippe Lang:</p>
<p>I'm still getting this error and have been since I reported this. I've committed <a class="changeset" title="Use assert_select to check the download link. (#4204)" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/3558">r3558</a> to try and use a different method of checking the atom response. Let me know if it doesn't work on your system.</p> Redmine - Defect #4204: Failing test in test_show_atomhttps://www.redmine.org/issues/4204?journal_id=157692010-04-11T14:05:37ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul><p>It seems to be OK. Merged in 0.9-stable.</p>