]> source.dussan.org Git - redmine.git/commitdiff
Fixed that root projects are escaped twice in the project drop down (#11217).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 26 Jun 2012 16:54:30 +0000 (16:54 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 26 Jun 2012 16:54:30 +0000 (16:54 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9894 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
test/functional/welcome_controller_test.rb

index 8c328326fe78708a54e66ce3fb07bb8321af36e4..d32c86b75b10c6d2a1627d2833a3911cf89e91e5 100644 (file)
@@ -253,7 +253,7 @@ module ApplicationHelper
   def project_tree_options_for_select(projects, options = {})
     s = ''
     project_tree(projects) do |project, level|
-      name_prefix = (level > 0 ? ('&nbsp;' * 2 * level + '&#187; ').html_safe : '')
+      name_prefix = (level > 0 ? ('&nbsp;' * 2 * level + '&#187; ') : '').html_safe
       tag_options = {:value => project.id}
       if project == options[:selected] || (options[:selected].respond_to?(:include?) && options[:selected].include?(project))
         tag_options[:selected] = 'selected'
index af86f663872cede363da6e4a287d27f954ab0998..a846d1aaf094d53a5342cc847d99d10fb0128806 100644 (file)
@@ -96,6 +96,16 @@ class WelcomeControllerTest < ActionController::TestCase
     assert @controller.respond_to?(:call_hook)
   end
 
+  def test_project_jump_box_should_escape_names_once
+    Project.find(1).update_attribute :name, 'Foo & Bar'
+    @request.session[:user_id] = 2
+
+    get :index
+    assert_select "#header select" do
+      assert_select "option", :text => 'Foo &amp; Bar'
+    end
+  end
+
   context "test_api_offset_and_limit" do
     context "without params" do
       should "return 0, 25" do