summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-06-20 14:01:50 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-06-20 14:01:50 +0000
commitc4a9d4cd4df130fa84e5c1948fc93d1f2b0bba5a (patch)
treea62a8e23e74efd319ae5ff533ea82eeed3ca55ec /test/unit
parent3ddab944d565cfaa7591c8baa603f9738c0b14a3 (diff)
downloadredmine-c4a9d4cd4df130fa84e5c1948fc93d1f2b0bba5a.tar.gz
redmine-c4a9d4cd4df130fa84e5c1948fc93d1f2b0bba5a.zip
Issue macro for flexible linking to issues (#29489).
Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@18297 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/lib/redmine/wiki_formatting/macros_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/wiki_formatting/macros_test.rb b/test/unit/lib/redmine/wiki_formatting/macros_test.rb
index b91638274..95b886e85 100644
--- a/test/unit/lib/redmine/wiki_formatting/macros_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/macros_test.rb
@@ -408,4 +408,14 @@ EXPECTED
text = "*{{hello_world}}*"
assert_match %r|\A<p><strong>Hello world!.*</strong></p>\z|, textilizable(text)
end
+
+ def test_issue_macro_should_not_render_link_if_not_visible
+ assert_equal "<p>#123</p>", textilizable('{{issue(123)}}')
+ end
+
+ def test_issue_macro_should_render_link_to_issue
+ issue = Issue.find 1
+ assert_equal %{<p><a class="issue tracker-1 status-1 priority-4 priority-lowest" href="/issues/1">Bug #1</a>: #{issue.subject}</p>}, textilizable("{{issue(1)}}")
+ assert_equal %{<p>eCookbook - <a class="issue tracker-1 status-1 priority-4 priority-lowest" href="/issues/1">Bug #1</a>: #{issue.subject}</p>}, textilizable("{{issue(1, project=true)}}")
+ end
end