|
@@
-90,7
+90,7
class TimeEntryReportsControllerTest < ActionController::TestCase
|
|
90
|
90
|
end
|
|
91
|
91
|
|
|
92
|
92
|
def test_report_two_criteria
|
|
93
|
|
get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criteria => ["member", "activity"]
|
|
|
93
|
get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criteria => ["user", "activity"]
|
|
94
|
94
|
assert_response :success
|
|
95
|
95
|
assert_template 'report'
|
|
96
|
96
|
assert_not_nil assigns(:report)
|
|
@@
-108,7
+108,7
class TimeEntryReportsControllerTest < ActionController::TestCase
|
|
108
|
108
|
end
|
|
109
|
109
|
|
|
110
|
110
|
def test_report_one_day
|
|
111
|
|
get :report, :project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criteria => ["member", "activity"]
|
|
|
111
|
get :report, :project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criteria => ["user", "activity"]
|
|
112
|
112
|
assert_response :success
|
|
113
|
113
|
assert_template 'report'
|
|
114
|
114
|
assert_not_nil assigns(:report)
|
|
@@
-116,7
+116,7
class TimeEntryReportsControllerTest < ActionController::TestCase
|
|
116
|
116
|
end
|
|
117
|
117
|
|
|
118
|
118
|
def test_report_at_issue_level
|
|
119
|
|
get :report, :project_id => 1, :issue_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criteria => ["member", "activity"]
|
|
|
119
|
get :report, :project_id => 1, :issue_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criteria => ["user", "activity"]
|
|
120
|
120
|
assert_response :success
|
|
121
|
121
|
assert_template 'report'
|
|
122
|
122
|
assert_not_nil assigns(:report)
|
|
@@
-161,12
+161,12
class TimeEntryReportsControllerTest < ActionController::TestCase
|
|
161
|
161
|
|
|
162
|
162
|
def test_report_all_projects_csv_export
|
|
163
|
163
|
get :report, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30",
|
|
164
|
|
:criteria => ["project", "member", "activity"], :format => "csv"
|
|
|
164
|
:criteria => ["project", "user", "activity"], :format => "csv"
|
|
165
|
165
|
assert_response :success
|
|
166
|
166
|
assert_equal 'text/csv; header=present', @response.content_type
|
|
167
|
167
|
lines = @response.body.chomp.split("\n")
|
|
168
|
168
|
# Headers
|
|
169
|
|
assert_equal 'Project,Member,Activity,2007-3,2007-4,Total', lines.first
|
|
|
169
|
assert_equal 'Project,User,Activity,2007-3,2007-4,Total', lines.first
|
|
170
|
170
|
# Total row
|
|
171
|
171
|
assert_equal 'Total,"","",154.25,8.65,162.90', lines.last
|
|
172
|
172
|
end
|
|
@@
-174,12
+174,12
class TimeEntryReportsControllerTest < ActionController::TestCase
|
|
174
|
174
|
def test_report_csv_export
|
|
175
|
175
|
get :report, :project_id => 1, :columns => 'month',
|
|
176
|
176
|
:from => "2007-01-01", :to => "2007-06-30",
|
|
177
|
|
:criteria => ["project", "member", "activity"], :format => "csv"
|
|
|
177
|
:criteria => ["project", "user", "activity"], :format => "csv"
|
|
178
|
178
|
assert_response :success
|
|
179
|
179
|
assert_equal 'text/csv; header=present', @response.content_type
|
|
180
|
180
|
lines = @response.body.chomp.split("\n")
|
|
181
|
181
|
# Headers
|
|
182
|
|
assert_equal 'Project,Member,Activity,2007-3,2007-4,Total', lines.first
|
|
|
182
|
assert_equal 'Project,User,Activity,2007-3,2007-4,Total', lines.first
|
|
183
|
183
|
# Total row
|
|
184
|
184
|
assert_equal 'Total,"","",154.25,8.65,162.90', lines.last
|
|
185
|
185
|
end
|
|
@@
-211,12
+211,12
class TimeEntryReportsControllerTest < ActionController::TestCase
|
|
211
|
211
|
|
|
212
|
212
|
get :report, :project_id => 1, :columns => 'day',
|
|
213
|
213
|
:from => "2011-11-11", :to => "2011-11-11",
|
|
214
|
|
:criteria => ["member"], :format => "csv"
|
|
|
214
|
:criteria => ["user"], :format => "csv"
|
|
215
|
215
|
assert_response :success
|
|
216
|
216
|
assert_equal 'text/csv; header=present', @response.content_type
|
|
217
|
217
|
lines = @response.body.chomp.split("\n")
|
|
218
|
218
|
# Headers
|
|
219
|
|
s1 = "\xa6\xa8\xad\xfb,2011-11-11,\xc1`\xadp"
|
|
|
219
|
s1 = "\xa5\xce\xa4\xe1,2011-11-11,\xc1`\xadp"
|
|
220
|
220
|
s2 = "\xc1`\xadp"
|
|
221
|
221
|
if s1.respond_to?(:force_encoding)
|
|
222
|
222
|
s1.force_encoding('Big5')
|
|
@@
-262,12
+262,12
class TimeEntryReportsControllerTest < ActionController::TestCase
|
|
262
|
262
|
|
|
263
|
263
|
get :report, :project_id => 1, :columns => 'day',
|
|
264
|
264
|
:from => "2011-11-11", :to => "2011-11-11",
|
|
265
|
|
:criteria => ["member"], :format => "csv"
|
|
|
265
|
:criteria => ["user"], :format => "csv"
|
|
266
|
266
|
assert_response :success
|
|
267
|
267
|
assert_equal 'text/csv; header=present', @response.content_type
|
|
268
|
268
|
lines = @response.body.chomp.split("\n")
|
|
269
|
269
|
# Headers
|
|
270
|
|
s1 = "\xa6\xa8\xad\xfb,2011-11-11,\xc1`\xadp"
|
|
|
270
|
s1 = "\xa5\xce\xa4\xe1,2011-11-11,\xc1`\xadp"
|
|
271
|
271
|
if s1.respond_to?(:force_encoding)
|
|
272
|
272
|
s1.force_encoding('Big5')
|
|
273
|
273
|
end
|
|
@@
-303,12
+303,12
class TimeEntryReportsControllerTest < ActionController::TestCase
|
|
303
|
303
|
|
|
304
|
304
|
get :report, :project_id => 1, :columns => 'day',
|
|
305
|
305
|
:from => "2011-11-11", :to => "2011-11-11",
|
|
306
|
|
:criteria => ["member"], :format => "csv"
|
|
|
306
|
:criteria => ["user"], :format => "csv"
|
|
307
|
307
|
assert_response :success
|
|
308
|
308
|
assert_equal 'text/csv; header=present', @response.content_type
|
|
309
|
309
|
lines = @response.body.chomp.split("\n")
|
|
310
|
310
|
# Headers
|
|
311
|
|
s1 = "Membre;2011-11-11;Total"
|
|
|
311
|
s1 = "Utilisateur;2011-11-11;Total"
|
|
312
|
312
|
s2 = "Total"
|
|
313
|
313
|
if s1.respond_to?(:force_encoding)
|
|
314
|
314
|
s1.force_encoding('ISO-8859-1')
|