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
This commit is contained in:
Jean-Philippe Lang
2019-06-20 14:01:50 +00:00
parent 3ddab944d5
commit c4a9d4cd4d
2 changed files with 37 additions and 0 deletions

View File

@@ -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