summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-01-11 11:22:46 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-01-11 11:22:46 +0000
commit8b999962dec50fc4599f77c1a23fbdc7b43dab21 (patch)
treebb9f2f7ea5bffa7f50779af1e129f4ed787f3944 /test/integration
parent2db3338ab22ffbccb69b51c97baeba51646ac1e3 (diff)
downloadredmine-8b999962dec50fc4599f77c1a23fbdc7b43dab21.tar.gz
redmine-8b999962dec50fc4599f77c1a23fbdc7b43dab21.zip
Make favicon themeable (#15689).
Patch by Felix Schäfer modified by Jean-Philippe Lang. git-svn-id: http://svn.redmine.org/redmine/trunk@12646 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/lib/redmine/themes_test.rb33
1 files changed, 32 insertions, 1 deletions
diff --git a/test/integration/lib/redmine/themes_test.rb b/test/integration/lib/redmine/themes_test.rb
index 6d286ef10..da413db35 100644
--- a/test/integration/lib/redmine/themes_test.rb
+++ b/test/integration/lib/redmine/themes_test.rb
@@ -57,9 +57,40 @@ class ThemesTest < ActionController::IntegrationTest
@theme.javascripts.delete 'theme'
end
+ def test_use_default_favicon_if_theme_provides_none
+ get '/'
+
+ assert_response :success
+ assert_select 'link[rel=shortcut icon][href^=/favicon.ico]'
+ end
+
+ def test_use_theme_favicon_if_theme_provides_one
+ # Simulate a theme favicon
+ @theme.favicons << 'a.ico'
+ get '/'
+
+ assert_response :success
+ assert_select "link[rel=shortcut icon][href^=/themes/#{@theme.dir}/favicon/a.ico]"
+ ensure
+ @theme.favicons.delete 'a.ico'
+ end
+
+ def test_use_only_one_theme_favicon_if_theme_provides_many
+ @theme.favicons.concat %w{b.ico a.png}
+ get '/'
+
+ assert_response :success
+ assert_select "link[rel=shortcut icon]", 1
+ assert_select "link[rel=shortcut icon][href^=/themes/#{@theme.dir}/favicon/b.ico]"
+ ensure
+ @theme.favicons.delete("b.ico")
+ @theme.favicons.delete("a.png")
+ end
+
def test_with_sub_uri
Redmine::Utils.relative_url_root = '/foo'
@theme.javascripts << 'theme'
+ @theme.favicons << 'a.ico'
get '/'
assert_response :success
@@ -67,7 +98,7 @@ class ThemesTest < ActionController::IntegrationTest
:attributes => {:href => %r{^/foo/themes/#{@theme.dir}/stylesheets/application.css}}
assert_tag :tag => 'script',
:attributes => {:src => %r{^/foo/themes/#{@theme.dir}/javascripts/theme.js}}
-
+ assert_select "link[rel=shortcut icon][href^=/foo/themes/#{@theme.dir}/favicon/a.ico]"
ensure
Redmine::Utils.relative_url_root = ''
end