Commit 33559129 authored by jplang's avatar jplang

Fixed that open/closed counts on issues summary are not displayed with SQLServer (#14369).

git-svn-id: https://svn.redmine.org/redmine/trunk@12060 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent bca399e7
......@@ -24,7 +24,7 @@ module ReportsHelper
data.each { |row|
match = 1
criteria.each { |k, v|
match = 0 unless (row[k].to_s == v.to_s) || (k == 'closed' && row[k] == (v == 0 ? "f" : "t"))
match = 0 unless (row[k].to_s == v.to_s) || (k == 'closed' && (v == 0 ? ['f', false] : ['t', true]).include?(row[k]))
} unless criteria.nil?
a = a + row["total"].to_i if match == 1
} unless data.nil?
......
......@@ -54,6 +54,24 @@ class ReportsControllerTest < ActionController::TestCase
end
end
def test_get_issue_report_details_by_tracker_should_show_issue_count
Issue.delete_all
Issue.generate!(:tracker_id => 1)
Issue.generate!(:tracker_id => 1)
Issue.generate!(:tracker_id => 1, :status_id => 5)
Issue.generate!(:tracker_id => 2)
get :issue_report_details, :id => 1, :detail => 'tracker'
assert_select 'table.list tbody :nth-child(1)' do
assert_select 'td', :text => 'Bug'
assert_select ':nth-child(2)', :text => '2' # status:1
assert_select ':nth-child(3)', :text => '-' # status:2
assert_select ':nth-child(8)', :text => '2' # open
assert_select ':nth-child(9)', :text => '1' # closed
assert_select ':nth-child(10)', :text => '3' # total
end
end
def test_get_issue_report_details_by_priority
get :issue_report_details, :id => 1, :detail => 'priority'
assert_equal IssuePriority.all.reverse, assigns(:rows)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment