diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2009-02-21 00:23:28 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2009-02-21 00:23:28 +0000 |
commit | 9a986ac0a51fe844eee816325e6a6d4122136d9a (patch) | |
tree | ae6e1de2aaa6adb2fc6952c47bf2fb79a644cb7d /test/unit | |
parent | 00b568c194db8fe1e1979795dfe548148647f431 (diff) | |
download | redmine-9a986ac0a51fe844eee816325e6a6d4122136d9a.tar.gz redmine-9a986ac0a51fe844eee816325e6a6d4122136d9a.zip |
Refactored the mess known as Hook default_url_options in favor of the simpler
:only_path as suggested by splatteal on GitHub.
#2542
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2491 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/lib/redmine/hook_test.rb | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/test/unit/lib/redmine/hook_test.rb b/test/unit/lib/redmine/hook_test.rb index 5ebe1e757..3e70c1c69 100644 --- a/test/unit/lib/redmine/hook_test.rb +++ b/test/unit/lib/redmine/hook_test.rb @@ -100,41 +100,11 @@ class Redmine::Hook::ManagerTest < Test::Unit::TestCase assert_equal ['Test hook 1 listener.', 'Test hook 2 listener.'], @hook_helper.call_hook(:view_layouts_base_html_head) end - # Context: Redmine::Hook::call_hook - def test_call_hook_default_url_options_set - request = ActionController::TestRequest.new - request.env = { "SERVER_NAME" => 'example.com'} + # Context: Redmine::Hook::Helper.call_hook default_url + def test_call_hook_default_url_options @hook_module.add_listener(TestLinkToHook) - assert_equal ['<a href="http://example.com/issues">Issues</a>'], - @hook_helper.call_hook(:view_layouts_base_html_head, :request => request) - end - - def test_call_hook_default_url_options_set_with_no_standard_request_port - request = ActionController::TestRequest.new - request.env = { "SERVER_NAME" => 'example.com', "SERVER_PORT" => 3000} - @hook_module.add_listener(TestLinkToHook) - - assert_equal ['<a href="http://example.com:3000/issues">Issues</a>'], - @hook_helper.call_hook(:view_layouts_base_html_head, :request => request) - end - - def test_call_hook_default_url_options_set_with_ssl - request = ActionController::TestRequest.new - request.env = { "SERVER_NAME" => 'example.com', "HTTPS" => 'on'} - @hook_module.add_listener(TestLinkToHook) - - assert_equal ['<a href="https://example.com/issues">Issues</a>'], - @hook_helper.call_hook(:view_layouts_base_html_head, :request => request) - end - - def test_call_hook_default_url_options_set_with_forwarded_ssl - request = ActionController::TestRequest.new - request.env = { "SERVER_NAME" => 'example.com', "HTTP_X_FORWARDED_PROTO" => "https"} - @hook_module.add_listener(TestLinkToHook) - - assert_equal ['<a href="https://example.com/issues">Issues</a>'], - @hook_helper.call_hook(:view_layouts_base_html_head, :request => request) + assert_equal ['<a href="/issues">Issues</a>'], @hook_helper.call_hook(:view_layouts_base_html_head) end # Context: Redmine::Hook::Helper.call_hook |