diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-18 08:09:31 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-18 08:09:31 +0000 |
commit | ff9be52e45ed67b3d57ccbfee62f7c230738109c (patch) | |
tree | daa72e5697aa2f69f3f45c3875b2a99164c17f0b /test/integration/lib/redmine | |
parent | 2ab1a9dccd3443f33933fb68824278e623d4e843 (diff) | |
download | redmine-ff9be52e45ed67b3d57ccbfee62f7c230738109c.tar.gz redmine-ff9be52e45ed67b3d57ccbfee62f7c230738109c.zip |
Ability to render multiple partials with view hook (#17763).
git-svn-id: http://svn.redmine.org/redmine/trunk@13449 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/lib/redmine')
-rw-r--r-- | test/integration/lib/redmine/hook_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/integration/lib/redmine/hook_test.rb b/test/integration/lib/redmine/hook_test.rb index 425e9610e..d6d581402 100644 --- a/test/integration/lib/redmine/hook_test.rb +++ b/test/integration/lib/redmine/hook_test.rb @@ -45,6 +45,14 @@ class HookTest < ActionController::IntegrationTest VIEW end + class SingleRenderOn < Redmine::Hook::ViewListener + render_on :view_welcome_index_left, :inline => 'SingleRenderOn 1' + end + + class MultipleRenderOn < Redmine::Hook::ViewListener + render_on :view_welcome_index_left, {:inline => 'MultipleRenderOn 1'}, {:inline => 'MultipleRenderOn 2'} + end + # Hooks that stores the call context class ContextTestHook < Redmine::Hook::ViewListener cattr_accessor :context @@ -105,4 +113,11 @@ VIEW assert_kind_of Hash, context[:request].params assert_kind_of AccountController, context[:hook_caller] end + + def test_multiple_hooks + Redmine::Hook.add_listener(SingleRenderOn) + Redmine::Hook.add_listener(MultipleRenderOn) + get '/' + assert_equal 1, response.body.scan("SingleRenderOn 1 MultipleRenderOn 1 MultipleRenderOn 2").size + end end |