summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-14 21:03:53 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-14 21:03:53 +0000
commit2230c11baa5c302af9850402b1d7c0734b8b39db (patch)
tree1f5355c612fe3b5549f917d331a9ccdf61c2475e /test
parent6ce28450c00483f0f6962d3e9022735cbe5b7903 (diff)
downloadredmine-2230c11baa5c302af9850402b1d7c0734b8b39db.tar.gz
redmine-2230c11baa5c302af9850402b1d7c0734b8b39db.zip
Use named route with attachment filename for inline images.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11189 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/helpers/application_helper_test.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index e097efe52..7e4505a74 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -132,12 +132,12 @@ RAW
def test_attached_images
to_test = {
- 'Inline image: !logo.gif!' => 'Inline image: <img src="/attachments/download/3" title="This is a logo" alt="This is a logo" />',
- 'Inline image: !logo.GIF!' => 'Inline image: <img src="/attachments/download/3" title="This is a logo" alt="This is a logo" />',
+ 'Inline image: !logo.gif!' => 'Inline image: <img src="/attachments/download/3/logo.gif" title="This is a logo" alt="This is a logo" />',
+ 'Inline image: !logo.GIF!' => 'Inline image: <img src="/attachments/download/3/logo.gif" title="This is a logo" alt="This is a logo" />',
'No match: !ogo.gif!' => 'No match: <img src="ogo.gif" alt="" />',
'No match: !ogo.GIF!' => 'No match: <img src="ogo.GIF" alt="" />',
# link image
- '!logo.gif!:http://foo.bar/' => '<a href="http://foo.bar/"><img src="/attachments/download/3" title="This is a logo" alt="This is a logo" /></a>',
+ '!logo.gif!:http://foo.bar/' => '<a href="http://foo.bar/"><img src="/attachments/download/3/logo.gif" title="This is a logo" alt="This is a logo" /></a>',
}
attachments = Attachment.all
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text, :attachments => attachments) }
@@ -183,13 +183,13 @@ RAW
to_test = {
'Inline image: !testtest.jpg!' =>
- 'Inline image: <img src="/attachments/download/' + a1.id.to_s + '" alt="" />',
+ 'Inline image: <img src="/attachments/download/' + a1.id.to_s + '/testtest.JPG" alt="" />',
'Inline image: !testtest.jpeg!' =>
- 'Inline image: <img src="/attachments/download/' + a2.id.to_s + '" alt="" />',
+ 'Inline image: <img src="/attachments/download/' + a2.id.to_s + '/testtest.jpeg" alt="" />',
'Inline image: !testtest.jpe!' =>
- 'Inline image: <img src="/attachments/download/' + a3.id.to_s + '" alt="" />',
+ 'Inline image: <img src="/attachments/download/' + a3.id.to_s + '/testtest.JPE" alt="" />',
'Inline image: !testtest.bmp!' =>
- 'Inline image: <img src="/attachments/download/' + a4.id.to_s + '" alt="" />',
+ 'Inline image: <img src="/attachments/download/' + a4.id.to_s + '/Testtest.BMP" alt="" />',
}
attachments = [a1, a2, a3, a4]
@@ -212,9 +212,9 @@ RAW
to_test = {
'Inline image: !testfile.png!' =>
- 'Inline image: <img src="/attachments/download/' + a2.id.to_s + '" alt="" />',
+ 'Inline image: <img src="/attachments/download/' + a2.id.to_s + '/testfile.PNG" alt="" />',
'Inline image: !Testfile.PNG!' =>
- 'Inline image: <img src="/attachments/download/' + a2.id.to_s + '" alt="" />',
+ 'Inline image: <img src="/attachments/download/' + a2.id.to_s + '/testfile.PNG" alt="" />',
}
attachments = [a1, a2]
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text, :attachments => attachments) }