From c4484a40c0e9a8a4576845b9ee5adc357dd377c5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 18 Oct 2014 10:14:17 +0000 Subject: 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 --- test/unit/lib/redmine/wiki_formatting/macros_test.rb | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'test') 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('testfile.PNG'.html_safe, + "/attachments/17", + :class => "thumbnail", + :title => "testfile.PNG") + assert_equal "

#{link}

", + textilizable("{{thumbnail(testfile.png)}}", :object => Issue.find(14)) + end + + def test_macro_thumbnail_with_full_path link = link_to('testfile.PNG'.html_safe, "http://test.host/attachments/17", :class => "thumbnail", :title => "testfile.PNG") assert_equal "

#{link}

", - 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('testfile.PNG'.html_safe, - "http://test.host/attachments/17", + link = link_to('testfile.PNG'.html_safe, + "/attachments/17", :class => "thumbnail", :title => "testfile.PNG") assert_equal "

#{link}

", @@ -320,8 +329,8 @@ RAW end def test_macro_thumbnail_with_title - link = link_to('testfile.PNG'.html_safe, - "http://test.host/attachments/17", + link = link_to('testfile.PNG'.html_safe, + "/attachments/17", :class => "thumbnail", :title => "Cool image") assert_equal "

#{link}

", -- cgit v1.2.3