summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-04-07 17:18:09 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-04-07 17:18:09 +0000
commit5d3454853956adee21518a1fc891b26f36c3c294 (patch)
tree0bc4eacf7c1e8ba914aeaf32f5ffe31dbc8c339d /test
parentfc1a295d8a51f49e75155835a766e8fc5f9d5977 (diff)
downloadredmine-5d3454853956adee21518a1fc891b26f36c3c294.tar.gz
redmine-5d3454853956adee21518a1fc891b26f36c3c294.zip
CSV export added to timelog report (#1009).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1338 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/timelog_controller_test.rb13
1 files changed, 12 insertions, 1 deletions
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