diff options
author | Go MAEDA <maeda@farend.jp> | 2018-04-01 00:29:22 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2018-04-01 00:29:22 +0000 |
commit | fa76ec5c0196a309d541edcc5fda6022e19aefe2 (patch) | |
tree | 2c5998add4166fffd3d91439683d6702aaf0d8e3 /test | |
parent | 07ce80f9b29b5878ddffe7a19bb167cb05dca463 (diff) | |
download | redmine-fa76ec5c0196a309d541edcc5fda6022e19aefe2.tar.gz redmine-fa76ec5c0196a309d541edcc5fda6022e19aefe2.zip |
Adds issue category filter to spent time queries (#28391).
Patch by Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/trunk@17249 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/timelog_controller_test.rb | 11 | ||||
-rw-r--r-- | test/unit/time_entry_query_test.rb | 5 |
2 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index 1dfe22987..02338e20d 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -1025,6 +1025,17 @@ class TimelogControllerTest < Redmine::ControllerTest assert_equal Tracker.where(:id => [1, 2, 3]).sorted.pluck(:name), values end + def test_index_with_issue_category_filter + get :index, :params => { + :project_id => 'ecookbook', + :f => ['issue.category_id'], + :op => {'issue.category_id' => '='}, + :v => {'issue.category_id' => ['1']} + } + assert_response :success + assert_equal ['1', '2'], css_select('input[name="ids[]"]').map {|e| e.attr('value')} + end + def test_index_with_filter_on_issue_custom_field issue = Issue.generate!(:project_id => 1, :tracker_id => 1, :custom_field_values => {2 => 'filter_on_issue_custom_field'}) entry = TimeEntry.generate!(:issue => issue, :hours => 2.5) diff --git a/test/unit/time_entry_query_test.rb b/test/unit/time_entry_query_test.rb index e00e33845..637f884f4 100644 --- a/test/unit/time_entry_query_test.rb +++ b/test/unit/time_entry_query_test.rb @@ -102,4 +102,9 @@ class TimeEntryQueryTest < ActiveSupport::TestCase assert_include "issue.cf_#{field_on_project.id}", query.available_columns.map(&:name).map(&:to_s) assert_not_include "issue.cf_#{field_not_on_project.id}", query.available_columns.map(&:name).map(&:to_s) end + + def test_issue_category_filter_should_not_be_available_in_global_queries + query = TimeEntryQuery.new(:project => nil, :name => '_') + assert !query.available_filters.has_key?('issue.category_id') + end end |