From 591922c365369c9052eddd5b57d10847257779f2 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 28 Jul 2013 20:46:04 +0000 Subject: [PATCH] Merged r12057 from trunk (#14415). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12063 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/timelog_controller.rb | 2 -- test/functional/timelog_controller_test.rb | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb index c8defb1c7..e1ee426c0 100644 --- a/app/controllers/timelog_controller.rb +++ b/app/controllers/timelog_controller.rb @@ -295,8 +295,6 @@ private scope = @query.results_scope(options) if @issue scope = scope.on_issue(@issue) - elsif @project - scope = scope.on_project(@project, Setting.display_subprojects_issues?) end scope end diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index f9c16aad7..50e9b6f58 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -443,6 +443,28 @@ class TimelogControllerTest < ActionController::TestCase :attributes => {:action => "/projects/ecookbook/time_entries", :id => 'query_form'} end + def test_index_with_display_subprojects_issues_to_false_should_not_include_subproject_entries + entry = TimeEntry.generate!(:project => Project.find(3)) + + with_settings :display_subprojects_issues => '0' do + get :index, :project_id => 'ecookbook' + assert_response :success + assert_template 'index' + assert_not_include entry, assigns(:entries) + end + end + + def test_index_with_display_subprojects_issues_to_false_and_subproject_filter_should_include_subproject_entries + entry = TimeEntry.generate!(:project => Project.find(3)) + + with_settings :display_subprojects_issues => '0' do + get :index, :project_id => 'ecookbook', :subproject_id => 3 + assert_response :success + assert_template 'index' + assert_include entry, assigns(:entries) + end + end + def test_index_at_project_level_with_date_range get :index, :project_id => 'ecookbook', :f => ['spent_on'],