summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-04-13 16:22:55 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-04-13 16:22:55 +0000
commit0329094f015bcc2036fc1a2545253b8e187ee794 (patch)
tree5a567aa9129358b572d83784357d1992018ca196 /test
parente64443571552e46fa1ecc34833e6f765b816a837 (diff)
downloadredmine-0329094f015bcc2036fc1a2545253b8e187ee794.tar.gz
redmine-0329094f015bcc2036fc1a2545253b8e187ee794.zip
Include macro can include a page of another project wiki using !{{include(projectname:Foo)}} (#1052).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1350 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/helpers/application_helper_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index f0de341c6..7ae6be4f3 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -168,6 +168,24 @@ class ApplicationHelperTest < HelperTestCase
assert_equal '<p>{{hello_world}}</p>', textilizable(text)
end
+ def test_macro_include
+ @project = Project.find(1)
+ # include a page of the current project wiki
+ text = "{{include(Another page)}}"
+ assert textilizable(text).match(/This is a link to a ticket/)
+
+ @project = nil
+ # include a page of a specific project wiki
+ text = "{{include(ecookbook:Another page)}}"
+ assert textilizable(text).match(/This is a link to a ticket/)
+
+ text = "{{include(ecookbook:)}}"
+ assert textilizable(text).match(/CookBook documentation/)
+
+ text = "{{include(unknowidentifier:somepage)}}"
+ assert textilizable(text).match(/Unknow project/)
+ end
+
def test_date_format_default
today = Date.today
Setting.date_format = ''