summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-11-23 08:24:00 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-11-23 08:24:00 +0000
commitbf3d9f08518b957b3d0ce5f273ed7e13dd9ab07e (patch)
tree62512038774ac763dd2ca369a40ed97a7c07c2f7
parenta74ffeff07491fd2c4b20ec37ca7c56e09caa258 (diff)
downloadredmine-bf3d9f08518b957b3d0ce5f273ed7e13dd9ab07e.tar.gz
redmine-bf3d9f08518b957b3d0ce5f273ed7e13dd9ab07e.zip
Merged r12310 (#15414).
git-svn-id: http://svn.redmine.org/redmine/branches/2.4-stable@12313 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/application_helper.rb11
-rw-r--r--test/functional/projects_controller_test.rb10
2 files changed, 13 insertions, 8 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 2b37ad312..7bee2117e 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1173,18 +1173,13 @@ module ApplicationHelper
super sources, options
end
- def content_for(name, content = nil, &block)
- @has_content ||= {}
- @has_content[name] = true
- super(name, content, &block)
- end
-
+ # TODO: remove this in 2.5.0
def has_content?(name)
- (@has_content && @has_content[name]) || false
+ content_for?(name)
end
def sidebar_content?
- has_content?(:sidebar) || view_layouts_base_sidebar_hook_response.present?
+ content_for?(:sidebar) || view_layouts_base_sidebar_hook_response.present?
end
def view_layouts_base_sidebar_hook_response
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index 79721d589..6f294d6d0 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -320,6 +320,16 @@ class ProjectsControllerTest < ActionController::TestCase
assert_select 'li', :text => /Development status/
end
+ def test_show_should_not_display_empty_sidebar
+ p = Project.find(1)
+ p.enabled_module_names = []
+ p.save!
+
+ get :show, :id => 'ecookbook'
+ assert_response :success
+ assert_select '#main.nosidebar'
+ end
+
def test_show_should_not_display_hidden_custom_fields
ProjectCustomField.find_by_name('Development status').update_attribute :visible, false
get :show, :id => 'ecookbook'