diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-28 11:21:58 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-28 11:21:58 +0000 |
commit | 2f9050115b6f5064fb563c95757639448fccfe43 (patch) | |
tree | f40332f350d9141cee271de9c284e05ba6c647fc /test/unit | |
parent | 37003787646589d8f55a0f40886ce1da4485b316 (diff) | |
download | redmine-2f9050115b6f5064fb563c95757639448fccfe43.tar.gz redmine-2f9050115b6f5064fb563c95757639448fccfe43.zip |
Adds a helper for building h2 tags and setting html_title (#14517).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12048 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 419a1b330..ebdc5d216 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -1231,4 +1231,38 @@ RAW s = raw_json(["foo"]) assert s.html_safe? end + + def test_html_title_should_app_title_if_not_set + assert_equal 'Redmine', html_title + end + + def test_html_title_should_join_items + html_title 'Foo', 'Bar' + assert_equal 'Foo - Bar - Redmine', html_title + end + + def test_html_title_should_append_current_project_name + @project = Project.find(1) + html_title 'Foo', 'Bar' + assert_equal 'Foo - Bar - eCookbook - Redmine', html_title + end + + def test_title_should_return_a_h2_tag + assert_equal '<h2>Foo</h2>', title('Foo') + end + + def test_title_should_set_html_title + title('Foo') + assert_equal 'Foo - Redmine', html_title + end + + def test_title_should_turn_arrays_into_links + assert_equal '<h2><a href="/foo">Foo</a></h2>', title(['Foo', '/foo']) + assert_equal 'Foo - Redmine', html_title + end + + def test_title_should_join_items + assert_equal '<h2>Foo » Bar</h2>', title('Foo', 'Bar') + assert_equal 'Bar - Foo - Redmine', html_title + end end |