diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-10-15 11:56:05 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-10-15 11:56:05 +0000 |
commit | 80cf4fd5db2f0b4194556fa0fa61deb70137519a (patch) | |
tree | 6210ef9da6c9c4683506ab0618100295b334b65d /test | |
parent | f793340077d0acb9fb8724122f8b49160e78a69c (diff) | |
download | redmine-80cf4fd5db2f0b4194556fa0fa61deb70137519a.tar.gz redmine-80cf4fd5db2f0b4194556fa0fa61deb70137519a.zip |
Merged r16999 and r17000 (#26667).
git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@17001 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/queries_controller_test.rb | 14 | ||||
-rw-r--r-- | test/functional/timelog_controller_test.rb | 21 |
2 files changed, 35 insertions, 0 deletions
diff --git a/test/functional/queries_controller_test.rb b/test/functional/queries_controller_test.rb index 6f3e3f664..0e4e64696 100644 --- a/test/functional/queries_controller_test.rb +++ b/test/functional/queries_controller_test.rb @@ -556,6 +556,20 @@ class QueriesControllerTest < Redmine::ControllerTest assert_include ["eCookbook - 2.0", "3", "open"], json end + def test_version_filter_time_entries_with_project_id_should_return_filter_values + @request.session[:user_id] = 2 + get :filter, :params => { + :project_id => 1, + :type => 'TimeEntryQuery', + :name => 'issue.fixed_version_id' + } + + assert_response :success + assert_equal 'application/json', response.content_type + json = ActiveSupport::JSON.decode(response.body) + assert_include ["eCookbook - 2.0", "3", "open"], json + end + def test_filter_without_project_id_should_return_filter_values @request.session[:user_id] = 2 get :filter, :params => { diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index 8d3804e5e..a0b3fad62 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -791,6 +791,27 @@ class TimelogControllerTest < Redmine::ControllerTest assert_select '.total-for-hours', :text => 'Hours: 5.00' end + def test_index_at_project_level_with_multiple_issue_fixed_version_ids + version = Version.generate!(:project_id => 1) + version2 = Version.generate!(:project_id => 1) + issue = Issue.generate!(:project_id => 1, :fixed_version => version) + issue2 = Issue.generate!(:project_id => 1, :fixed_version => version2) + TimeEntry.generate!(:issue => issue, :hours => 2) + TimeEntry.generate!(:issue => issue2, :hours => 3) + @request.session[:user_id] = 2 + + get :index, :params => { + :project_id => 'ecookbook', + :f => ['issue.fixed_version_id'], + :op => {'issue.fixed_version_id' => '='}, + :v => {'issue.fixed_version_id' => [version.id.to_s,version2.id.to_s]} + } + assert_response :success + + assert_select 'tr.time-entry', 2 + assert_select '.total-for-hours', :text => 'Hours: 5.00' + end + def test_index_at_project_level_with_date_range get :index, :params => { :project_id => 'ecookbook', |