summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-14 11:30:00 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-14 11:30:00 +0000
commit9206d077d4603c6ffc2d01ae152f129c6e88df6d (patch)
treeaeacf29a8da1dafda86516a598f6f82482762206 /test
parent91f39dea8f6250e01acf5fce3c1540f558044585 (diff)
downloadredmine-9206d077d4603c6ffc2d01ae152f129c6e88df6d.tar.gz
redmine-9206d077d4603c6ffc2d01ae152f129c6e88df6d.zip
Group versions by status in version custom field filter (#23265).
git-svn-id: http://svn.redmine.org/redmine/trunk@16194 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/lib/redmine/field_format/version_field_format_test.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/unit/lib/redmine/field_format/version_field_format_test.rb b/test/unit/lib/redmine/field_format/version_field_format_test.rb
index e6e9d1d00..22aeeb285 100644
--- a/test/unit/lib/redmine/field_format/version_field_format_test.rb
+++ b/test/unit/lib/redmine/field_format/version_field_format_test.rb
@@ -82,7 +82,19 @@ class Redmine::VersionFieldFormatTest < ActionView::TestCase
version = Version.generate!(:project => project, :status => 'locked')
query = Query.new(:project => project)
- assert_not_include version.name, field.possible_values_options(project).map(&:first)
- assert_include version.name, field.query_filter_options(query)[:values].call.map(&:first)
+ full_name = "#{version.project} - #{version.name}"
+ assert_not_include full_name, field.possible_values_options(project).map(&:first)
+ assert_include full_name, field.query_filter_options(query)[:values].call.map(&:first)
+ end
+
+ def test_query_filter_options_should_include_version_status_for_grouping
+ field = IssueCustomField.new(:field_format => 'version', :version_status => ["open"])
+ project = Project.find(1)
+ version = Version.generate!(:project => project, :status => 'locked')
+ query = Query.new(:project => project)
+
+ full_name = "#{version.project} - #{version.name}"
+ assert_include [full_name, version.id.to_s, l(:version_status_locked)],
+ field.query_filter_options(query)[:values].call
end
end