@@ -1173,18 +1173,13 module ApplicationHelper | |||
|
1173 | 1173 | super sources, options |
|
1174 | 1174 | end |
|
1175 | 1175 | |
|
1176 | def content_for(name, content = nil, &block) | |
|
1177 | @has_content ||= {} | |
|
1178 | @has_content[name] = true | |
|
1179 | super(name, content, &block) | |
|
1180 | end | |
|
1181 | ||
|
1176 | # TODO: remove this in 2.5.0 | |
|
1182 | 1177 | def has_content?(name) |
|
1183 | (@has_content && @has_content[name]) || false | |
|
1178 | content_for?(name) | |
|
1184 | 1179 | end |
|
1185 | 1180 | |
|
1186 | 1181 | def sidebar_content? |
|
1187 |
|
|
|
1182 | content_for?(:sidebar) || view_layouts_base_sidebar_hook_response.present? | |
|
1188 | 1183 | end |
|
1189 | 1184 | |
|
1190 | 1185 | def view_layouts_base_sidebar_hook_response |
@@ -320,6 +320,16 class ProjectsControllerTest < ActionController::TestCase | |||
|
320 | 320 | assert_select 'li', :text => /Development status/ |
|
321 | 321 | end |
|
322 | 322 | |
|
323 | def test_show_should_not_display_empty_sidebar | |
|
324 | p = Project.find(1) | |
|
325 | p.enabled_module_names = [] | |
|
326 | p.save! | |
|
327 | ||
|
328 | get :show, :id => 'ecookbook' | |
|
329 | assert_response :success | |
|
330 | assert_select '#main.nosidebar' | |
|
331 | end | |
|
332 | ||
|
323 | 333 | def test_show_should_not_display_hidden_custom_fields |
|
324 | 334 | ProjectCustomField.find_by_name('Development status').update_attribute :visible, false |
|
325 | 335 | get :show, :id => 'ecookbook' |
General Comments 0
You need to be logged in to leave comments.
Login now