summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-18 10:14:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-18 10:14:17 +0000
commitc4484a40c0e9a8a4576845b9ee5adc357dd377c5 (patch)
tree285c20f4f40f05a768fa60f5bd743b4c357fc987 /test
parent6bdef3ca64f30c391c5433a5a7edfbbdf3c4fa14 (diff)
downloadredmine-c4484a40c0e9a8a4576845b9ee5adc357dd377c5.tar.gz
redmine-c4484a40c0e9a8a4576845b9ee5adc357dd377c5.zip
Use relative URL for thumbnails according to :only_path option (#18119).
git-svn-id: http://svn.redmine.org/redmine/trunk@13451 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/lib/redmine/wiki_formatting/macros_test.rb19
1 files changed, 14 insertions, 5 deletions
diff --git a/test/unit/lib/redmine/wiki_formatting/macros_test.rb b/test/unit/lib/redmine/wiki_formatting/macros_test.rb
index 443b6f4d8..7f5308d1b 100644
--- a/test/unit/lib/redmine/wiki_formatting/macros_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/macros_test.rb
@@ -302,17 +302,26 @@ RAW
end
def test_macro_thumbnail
+ link = link_to('<img alt="testfile.PNG" src="/attachments/thumbnail/17" />'.html_safe,
+ "/attachments/17",
+ :class => "thumbnail",
+ :title => "testfile.PNG")
+ assert_equal "<p>#{link}</p>",
+ textilizable("{{thumbnail(testfile.png)}}", :object => Issue.find(14))
+ end
+
+ def test_macro_thumbnail_with_full_path
link = link_to('<img alt="testfile.PNG" src="http://test.host/attachments/thumbnail/17" />'.html_safe,
"http://test.host/attachments/17",
:class => "thumbnail",
:title => "testfile.PNG")
assert_equal "<p>#{link}</p>",
- textilizable("{{thumbnail(testfile.png)}}", :object => Issue.find(14))
+ textilizable("{{thumbnail(testfile.png)}}", :object => Issue.find(14), :only_path => false)
end
def test_macro_thumbnail_with_size
- link = link_to('<img alt="testfile.PNG" src="http://test.host/attachments/thumbnail/17/200" />'.html_safe,
- "http://test.host/attachments/17",
+ link = link_to('<img alt="testfile.PNG" src="/attachments/thumbnail/17/200" />'.html_safe,
+ "/attachments/17",
:class => "thumbnail",
:title => "testfile.PNG")
assert_equal "<p>#{link}</p>",
@@ -320,8 +329,8 @@ RAW
end
def test_macro_thumbnail_with_title
- link = link_to('<img alt="testfile.PNG" src="http://test.host/attachments/thumbnail/17" />'.html_safe,
- "http://test.host/attachments/17",
+ link = link_to('<img alt="testfile.PNG" src="/attachments/thumbnail/17" />'.html_safe,
+ "/attachments/17",
:class => "thumbnail",
:title => "Cool image")
assert_equal "<p>#{link}</p>",