From 5d3454853956adee21518a1fc891b26f36c3c294 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 7 Apr 2008 17:18:09 +0000 Subject: CSV export added to timelog report (#1009). git-svn-id: http://redmine.rubyforge.org/svn/trunk@1338 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/timelog_controller_test.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test/functional/timelog_controller_test.rb') diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index 6e3308c84..4d6cb0b36 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -118,7 +118,18 @@ class TimelogControllerTest < Test::Unit::TestCase assert_template 'report' assert_not_nil assigns(:total_hours) assert_equal "0.00", "%.2f" % assigns(:total_hours) - end + end + + def test_report_csv_export + get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30", :criterias => ["project", "member", "activity"], :format => "csv" + assert_response :success + assert_equal 'text/csv', @response.content_type + lines = @response.body.chomp.split("\n") + # Headers + assert_equal 'Project,Member,Activity,2007-1,2007-2,2007-3,2007-4,2007-5,2007-6,Total', lines.first + # Total row + assert_equal 'Total,"","","","",154.25,8.65,"","",162.90', lines.last + end def test_details_at_project_level get :details, :project_id => 1 -- cgit v1.2.3