@@ -14,10 +14,10 | |||
|
14 | 14 | <% end %> |
|
15 | 15 | </tr> |
|
16 | 16 | </thead> |
|
17 | <% previous_group = false %> | |
|
17 | <% previous_group, first = false, true %> | |
|
18 | 18 | <tbody> |
|
19 | 19 | <% issue_list(issues) do |issue, level| -%> |
|
20 | <% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %> | |
|
20 | <% if @query.grouped? && ((group = @query.group_by_column.value(issue)) != previous_group || first) %> | |
|
21 | 21 | <% reset_cycle %> |
|
22 | 22 | <tr class="group open"> |
|
23 | 23 | <td colspan="<%= query.inline_columns.size + 2 %>"> |
@@ -27,7 +27,7 | |||
|
27 | 27 | "toggleAllRowGroups(this)", :class => 'toggle-all') %> |
|
28 | 28 | </td> |
|
29 | 29 | </tr> |
|
30 | <% previous_group = group %> | |
|
30 | <% previous_group, first = group, false %> | |
|
31 | 31 | <% end %> |
|
32 | 32 | <tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>"> |
|
33 | 33 | <td class="checkbox hide-when-print"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td> |
@@ -305,11 +305,27 class IssuesControllerTest < ActionController::TestCase | |||
|
305 | 305 | assert_response :success |
|
306 | 306 | end |
|
307 | 307 | |
|
308 | assert_select 'tr.group', 3 | |
|
308 | 309 | assert_select 'tr.group', :text => /Yes/ |
|
309 | 310 | assert_select 'tr.group', :text => /No/ |
|
310 | 311 | assert_select 'tr.group', :text => /none/ |
|
311 | 312 | end |
|
312 | 313 | |
|
314 | def test_index_grouped_by_boolean_custom_field_with_false_group_in_first_position_should_show_the_group | |
|
315 | cf = IssueCustomField.create!(:name => 'Bool', :is_for_all => true, :tracker_ids => [1,2,3], :field_format => 'bool', :is_filter => true) | |
|
316 | CustomValue.create!(:custom_field => cf, :customized => Issue.find(1), :value => '0') | |
|
317 | CustomValue.create!(:custom_field => cf, :customized => Issue.find(2), :value => '0') | |
|
318 | ||
|
319 | with_settings :default_language => 'en' do | |
|
320 | get :index, :project_id => 1, :set_filter => 1, "cf_#{cf.id}" => "*", :group_by => "cf_#{cf.id}" | |
|
321 | assert_response :success | |
|
322 | assert_equal [1, 2], assigns(:issues).map(&:id).sort | |
|
323 | end | |
|
324 | ||
|
325 | assert_select 'tr.group', 1 | |
|
326 | assert_select 'tr.group', :text => /No/ | |
|
327 | end | |
|
328 | ||
|
313 | 329 | def test_index_with_query_grouped_by_tracker_in_normal_order |
|
314 | 330 | 3.times {|i| Issue.generate!(:tracker_id => (i + 1))} |
|
315 | 331 |
General Comments 0
You need to be logged in to leave comments.
Login now