]> source.dussan.org Git - redmine.git/commitdiff
Adds a test for macro registration.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 3 Dec 2011 15:29:51 +0000 (15:29 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 3 Dec 2011 15:29:51 +0000 (15:29 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8054 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/lib/redmine/wiki_formatting/macros_test.rb

index 704e745283db0011159b2b54364939af77d9199c..e6f06489c60cdac8689251ea89eaf708b2df3dc6 100644 (file)
@@ -39,6 +39,17 @@ class Redmine::WikiFormatting::MacrosTest < ActionView::TestCase
   def teardown
   end
 
+  def test_macro_registration
+    Redmine::WikiFormatting::Macros.register do
+      macro :foo do
+        "Foo macro output"
+      end
+    end
+
+    text = "{{foo}}"
+    assert_equal '<p>Foo macro output</p>', textilizable(text)
+  end
+
   def test_macro_hello_world
     text = "{{hello_world}}"
     assert textilizable(text).match(/Hello world!/)