From a0479c768ef80cbdaaf858b7550793fd327fc04c Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 29 Oct 2018 04:05:18 +0000 Subject: Filter time entries after project status (#20081). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17608 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/time_entry_query_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/unit/time_entry_query_test.rb') diff --git a/test/unit/time_entry_query_test.rb b/test/unit/time_entry_query_test.rb index e2f7caac2..2f6891893 100644 --- a/test/unit/time_entry_query_test.rb +++ b/test/unit/time_entry_query_test.rb @@ -108,4 +108,19 @@ class TimeEntryQueryTest < ActiveSupport::TestCase query = TimeEntryQuery.new(:project => nil, :name => '_') assert !query.available_filters.has_key?('issue.category_id') end + + def test_project_status_filter_should_be_available_in_global_queries + query = TimeEntryQuery.new(:project => nil, :name => '_') + assert query.available_filters.has_key?('project.status') + end + + def test_project_status_filter_should_be_available_when_project_has_subprojects + query = TimeEntryQuery.new(:project => Project.find(1), :name => '_') + assert query.available_filters.has_key?('project.status') + end + + def test_project_status_filter_should_not_be_available_when_project_is_leaf + query = TimeEntryQuery.new(:project => Project.find(2), :name => '_') + assert !query.available_filters.has_key?('project.status') + end end -- cgit v1.2.3