From: Jean-Philippe Lang Date: Wed, 18 Feb 2015 11:33:40 +0000 (+0000) Subject: Merged r13921 (#18894). X-Git-Tag: 2.6.2~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a5a7c62b69f1dde4fd3e1185095f7e6ed0786ec4;p=redmine.git Merged r13921 (#18894). git-svn-id: http://svn.redmine.org/redmine/branches/2.6-stable@14020 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index fb190d42b..48b5860a7 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -22,7 +22,7 @@   - <%= group.blank? ? l(:label_none) : column_content(@query.group_by_column, issue) %> <%= @issue_count_by_group[group] %> + <%= (group.blank? && group != false) ? l(:label_none) : column_content(@query.group_by_column, issue) %> <%= @issue_count_by_group[group] %> <%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}", "toggleAllRowGroups(this)", :class => 'toggle-all') %> diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index be698e3b1..1e3498241 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -294,6 +294,22 @@ class IssuesControllerTest < ActionController::TestCase end end + def test_index_grouped_by_boolean_custom_field_should_distinguish_blank_and_false_values + cf = IssueCustomField.create!(:name => 'Bool', :is_for_all => true, :tracker_ids => [1,2,3], :field_format => 'bool') + CustomValue.create!(:custom_field => cf, :customized => Issue.find(1), :value => '1') + CustomValue.create!(:custom_field => cf, :customized => Issue.find(2), :value => '0') + CustomValue.create!(:custom_field => cf, :customized => Issue.find(3), :value => '') + + with_settings :default_language => 'en' do + get :index, :project_id => 1, :set_filter => 1, :group_by => "cf_#{cf.id}" + assert_response :success + end + + assert_select 'tr.group', :text => /Yes/ + assert_select 'tr.group', :text => /No/ + assert_select 'tr.group', :text => /none/ + end + def test_index_with_query_grouped_by_tracker_in_normal_order 3.times {|i| Issue.generate!(:tracker_id => (i + 1))}