@@ -24,7 +24,7 module ReportsHelper | |||
|
24 | 24 | data.each { |row| |
|
25 | 25 | match = 1 |
|
26 | 26 | criteria.each { |k, v| |
|
27 |
match = 0 unless (row[k].to_s == v.to_s) || (k == 'closed' && |
|
|
27 | match = 0 unless (row[k].to_s == v.to_s) || (k == 'closed' && (v == 0 ? ['f', false] : ['t', true]).include?(row[k])) | |
|
28 | 28 | } unless criteria.nil? |
|
29 | 29 | a = a + row["total"].to_i if match == 1 |
|
30 | 30 | } unless data.nil? |
@@ -54,6 +54,24 class ReportsControllerTest < ActionController::TestCase | |||
|
54 | 54 | end |
|
55 | 55 | end |
|
56 | 56 | |
|
57 | def test_get_issue_report_details_by_tracker_should_show_issue_count | |
|
58 | Issue.delete_all | |
|
59 | Issue.generate!(:tracker_id => 1) | |
|
60 | Issue.generate!(:tracker_id => 1) | |
|
61 | Issue.generate!(:tracker_id => 1, :status_id => 5) | |
|
62 | Issue.generate!(:tracker_id => 2) | |
|
63 | ||
|
64 | get :issue_report_details, :id => 1, :detail => 'tracker' | |
|
65 | assert_select 'table.list tbody :nth-child(1)' do | |
|
66 | assert_select 'td', :text => 'Bug' | |
|
67 | assert_select ':nth-child(2)', :text => '2' # status:1 | |
|
68 | assert_select ':nth-child(3)', :text => '-' # status:2 | |
|
69 | assert_select ':nth-child(8)', :text => '2' # open | |
|
70 | assert_select ':nth-child(9)', :text => '1' # closed | |
|
71 | assert_select ':nth-child(10)', :text => '3' # total | |
|
72 | end | |
|
73 | end | |
|
74 | ||
|
57 | 75 | def test_get_issue_report_details_by_priority |
|
58 | 76 | get :issue_report_details, :id => 1, :detail => 'priority' |
|
59 | 77 | assert_equal IssuePriority.all.reverse, assigns(:rows) |
General Comments 0
You need to be logged in to leave comments.
Login now