]> source.dussan.org Git - redmine.git/commitdiff
Spent time details and report should ignore 'Setting.display_subprojects_issues?...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 28 Jul 2013 15:16:14 +0000 (15:16 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 28 Jul 2013 15:16:14 +0000 (15:16 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12057 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/timelog_controller.rb
test/functional/timelog_controller_test.rb

index 111925cf7b9aebbec801269b15323858a4fd64a3..1a880a133780fb13fcf4e5d5a234519eee0afcc6 100644 (file)
@@ -284,8 +284,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
index 9d07d3e21a8ceb17c5de38e8c9b4d94faaaf72db..6ea3a20b8ae0167d415c186292ff5369436de756 100644 (file)
@@ -451,6 +451,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'],