summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-03-13 08:03:08 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-03-13 08:03:08 +0000
commit65e2e932d1b9b48a6bd5ec002da2fd903b2c6c58 (patch)
treebf0548922b7b187e6a41ce73e2f44fa087b8178c /test/functional
parentd09b08046343d5fcd6a15024fdc8f48e73c9d064 (diff)
downloadredmine-65e2e932d1b9b48a6bd5ec002da2fd903b2c6c58.tar.gz
redmine-65e2e932d1b9b48a6bd5ec002da2fd903b2c6c58.zip
Merged r15224 (#22178).
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@15227 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/issues_controller_test.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 2342cf7d9..6729d0604 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -281,6 +281,32 @@ class IssuesControllerTest < ActionController::TestCase
assert_not_nil assigns(:issue_count_by_group)
end
+ def test_index_with_query_grouped_by_key_value_custom_field
+ cf = IssueCustomField.create!(:name => 'Key', :is_for_all => true, :tracker_ids => [1,2,3], :field_format => 'enumeration')
+ cf.enumerations << valueb = CustomFieldEnumeration.new(:name => 'Value B', :position => 1)
+ cf.enumerations << valuea = CustomFieldEnumeration.new(:name => 'Value A', :position => 2)
+ CustomValue.create!(:custom_field => cf, :customized => Issue.find(1), :value => valueb.id)
+ CustomValue.create!(:custom_field => cf, :customized => Issue.find(2), :value => valueb.id)
+ CustomValue.create!(:custom_field => cf, :customized => Issue.find(3), :value => valuea.id)
+ CustomValue.create!(:custom_field => cf, :customized => Issue.find(5), :value => '')
+
+ get :index, :project_id => 1, :set_filter => 1, :group_by => "cf_#{cf.id}"
+ assert_response :success
+ assert_template 'index'
+ assert_not_nil assigns(:issues)
+ assert_not_nil assigns(:issue_count_by_group)
+
+ assert_select 'tr.group', 3
+ assert_select 'tr.group' do
+ assert_select 'span.name', :text => 'Value B'
+ assert_select 'span.count', :text => '2'
+ end
+ assert_select 'tr.group' do
+ assert_select 'span.name', :text => 'Value A'
+ assert_select 'span.count', :text => '1'
+ end
+ end
+
def test_index_with_query_grouped_by_user_custom_field
cf = IssueCustomField.create!(:name => 'User', :is_for_all => true, :tracker_ids => [1,2,3], :field_format => 'user')
CustomValue.create!(:custom_field => cf, :customized => Issue.find(1), :value => '2')