From 68f8470d4af60c71d024059b96ad53f2968b1bf2 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 28 Apr 2012 09:47:09 +0000 Subject: Makes image_tag pick the image from the current theme if it exists. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9560 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/helpers/application_helper_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/unit') diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 9bf25e605..6dea2cf57 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -1058,6 +1058,18 @@ RAW assert_match 'src="/images/image.png"', image_tag("image.png") end + def test_image_tag_should_pick_the_theme_image_if_it_exists + theme = Redmine::Themes.themes.last + theme.images << 'image.png' + + with_settings :ui_theme => theme.id do + assert_match %|src="/themes/#{theme.dir}/images/image.png"|, image_tag("image.png") + assert_match %|src="/images/other.png"|, image_tag("other.png") + end + ensure + theme.images.delete 'image.png' + end + def test_image_tag_sfor_plugin_should_pick_the_plugin_image assert_match 'src="/plugin_assets/foo/images/image.png"', image_tag("image.png", :plugin => :foo) end -- cgit v1.2.3