@@ -11,7 +11,7 class TimeEntryReportsControllerTest < ActionController::TestCase | |||
|
11 | 11 | assert_tag :form, |
|
12 | 12 | :attributes => {:action => "/projects/ecookbook/time_entries/report", :id => 'query_form'} |
|
13 | 13 | end |
|
14 | ||
|
14 | ||
|
15 | 15 | def test_report_all_projects |
|
16 | 16 | get :report |
|
17 | 17 | assert_response :success |
@@ -19,7 +19,7 class TimeEntryReportsControllerTest < ActionController::TestCase | |||
|
19 | 19 | assert_tag :form, |
|
20 | 20 | :attributes => {:action => "/time_entries/report", :id => 'query_form'} |
|
21 | 21 | end |
|
22 | ||
|
22 | ||
|
23 | 23 | def test_report_all_projects_denied |
|
24 | 24 | r = Role.anonymous |
|
25 | 25 | r.permissions.delete(:view_time_entries) |
@@ -28,7 +28,7 class TimeEntryReportsControllerTest < ActionController::TestCase | |||
|
28 | 28 | get :report |
|
29 | 29 | assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Ftime_entries%2Freport' |
|
30 | 30 | end |
|
31 | ||
|
31 | ||
|
32 | 32 | def test_report_all_projects_one_criteria |
|
33 | 33 | get :report, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criterias => ['project'] |
|
34 | 34 | assert_response :success |
@@ -53,7 +53,7 class TimeEntryReportsControllerTest < ActionController::TestCase | |||
|
53 | 53 | assert_equal "162.90", "%.2f" % assigns(:total_hours) |
|
54 | 54 | assert_tag :tag => 'th', :content => '2007-03-12' |
|
55 | 55 | end |
|
56 | ||
|
56 | ||
|
57 | 57 | def test_report_one_criteria |
|
58 | 58 | get :report, :project_id => 1, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criterias => ['project'] |
|
59 | 59 | assert_response :success |
@@ -61,7 +61,7 class TimeEntryReportsControllerTest < ActionController::TestCase | |||
|
61 | 61 | assert_not_nil assigns(:total_hours) |
|
62 | 62 | assert_equal "8.65", "%.2f" % assigns(:total_hours) |
|
63 | 63 | end |
|
64 | ||
|
64 | ||
|
65 | 65 | def test_report_two_criterias |
|
66 | 66 | get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criterias => ["member", "activity"] |
|
67 | 67 | assert_response :success |
@@ -69,7 +69,7 class TimeEntryReportsControllerTest < ActionController::TestCase | |||
|
69 | 69 | assert_not_nil assigns(:total_hours) |
|
70 | 70 | assert_equal "162.90", "%.2f" % assigns(:total_hours) |
|
71 | 71 | end |
|
72 | ||
|
72 | ||
|
73 | 73 | def test_report_one_day |
|
74 | 74 | get :report, :project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criterias => ["member", "activity"] |
|
75 | 75 | assert_response :success |
@@ -77,7 +77,7 class TimeEntryReportsControllerTest < ActionController::TestCase | |||
|
77 | 77 | assert_not_nil assigns(:total_hours) |
|
78 | 78 | assert_equal "4.25", "%.2f" % assigns(:total_hours) |
|
79 | 79 | end |
|
80 | ||
|
80 | ||
|
81 | 81 | def test_report_at_issue_level |
|
82 | 82 | get :report, :project_id => 1, :issue_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criterias => ["member", "activity"] |
|
83 | 83 | assert_response :success |
@@ -87,7 +87,7 class TimeEntryReportsControllerTest < ActionController::TestCase | |||
|
87 | 87 | assert_tag :form, |
|
88 | 88 | :attributes => {:action => "/projects/ecookbook/issues/1/time_entries/report", :id => 'query_form'} |
|
89 | 89 | end |
|
90 | ||
|
90 | ||
|
91 | 91 | def test_report_custom_field_criteria |
|
92 | 92 | get :report, :project_id => 1, :criterias => ['project', 'cf_1', 'cf_7'] |
|
93 | 93 | assert_response :success |
@@ -106,7 +106,7 class TimeEntryReportsControllerTest < ActionController::TestCase | |||
|
106 | 106 | # Second custom field column |
|
107 | 107 | assert_tag :tag => 'th', :content => 'Billable' |
|
108 | 108 | end |
|
109 | ||
|
109 | ||
|
110 | 110 | def test_report_one_criteria_no_result |
|
111 | 111 | get :report, :project_id => 1, :columns => 'week', :from => "1998-04-01", :to => "1998-04-30", :criterias => ['project'] |
|
112 | 112 | assert_response :success |
@@ -114,7 +114,7 class TimeEntryReportsControllerTest < ActionController::TestCase | |||
|
114 | 114 | assert_not_nil assigns(:total_hours) |
|
115 | 115 | assert_equal "0.00", "%.2f" % assigns(:total_hours) |
|
116 | 116 | end |
|
117 | ||
|
117 | ||
|
118 | 118 | def test_report_all_projects_csv_export |
|
119 | 119 | get :report, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30", :criterias => ["project", "member", "activity"], :format => "csv" |
|
120 | 120 | assert_response :success |
@@ -125,7 +125,7 class TimeEntryReportsControllerTest < ActionController::TestCase | |||
|
125 | 125 | # Total row |
|
126 | 126 | assert_equal 'Total,"","","","",154.25,8.65,"","",162.90', lines.last |
|
127 | 127 | end |
|
128 | ||
|
128 | ||
|
129 | 129 | def test_report_csv_export |
|
130 | 130 | get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30", :criterias => ["project", "member", "activity"], :format => "csv" |
|
131 | 131 | assert_response :success |
@@ -136,5 +136,5 class TimeEntryReportsControllerTest < ActionController::TestCase | |||
|
136 | 136 | # Total row |
|
137 | 137 | assert_equal 'Total,"","","","",154.25,8.65,"","",162.90', lines.last |
|
138 | 138 | end |
|
139 | ||
|
139 | ||
|
140 | 140 | end |
General Comments 0
You need to be logged in to leave comments.
Login now