summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-11-10 00:42:30 +0000
committerGo MAEDA <maeda@farend.jp>2019-11-10 00:42:30 +0000
commit1c533c948b9e749099495ad79e80faa3f4b65aaa (patch)
tree111570895f9f3314f17dadcfa6e636b4e4bef498 /test
parente7121752c2dbb81fead71249c81e24967a0677ea (diff)
downloadredmine-1c533c948b9e749099495ad79e80faa3f4b65aaa.tar.gz
redmine-1c533c948b9e749099495ad79e80faa3f4b65aaa.zip
Adds "Target Version" column to the list of "Available columns" in "Spent time" tab (#30346).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@19059 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/timelog_controller_test.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb
index 152912bd9..f23a10c10 100644
--- a/test/functional/timelog_controller_test.rb
+++ b/test/functional/timelog_controller_test.rb
@@ -1193,6 +1193,20 @@ class TimelogControllerTest < Redmine::ControllerTest
assert_select 'td.issue-category', :text => 'Printing'
end
+ def test_index_with_issue_fixed_version_column
+ issue = Issue.find(1)
+ issue.fixed_version = Version.find(3)
+ issue.save!
+
+ get :index, :params => {
+ :project_id => 'ecookbook',
+ :c => %w(project spent_on issue comments hours issue.fixed_version)
+ }
+
+ assert_response :success
+ assert_select 'td.issue-fixed_version', :text => '2.0'
+ end
+
def test_index_with_author_filter
get :index, :params => {
:project_id => 'ecookbook',
@@ -1230,6 +1244,25 @@ class TimelogControllerTest < Redmine::ControllerTest
assert_equal ['Printing', 'Printing', 'Recipes'], values
end
+ def test_index_with_issue_fixed_version_sort
+ issue = Issue.find(1)
+ issue.fixed_version = Version.find(3)
+ issue.save!
+
+ TimeEntry.generate!(:issue => Issue.find(12))
+
+ get :index, :params => {
+ :project_id => 'ecookbook',
+ :c => ["hours", 'issue.fixed_version'],
+ :sort => 'issue.fixed_version'
+ }
+
+ assert_response :success
+ # Make sure that values are properly sorted
+ values = css_select("td.issue-fixed_version").map(&:text).reject(&:blank?)
+ assert_equal ['1.0', '2.0', '2.0'], values
+ 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)