summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
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>",