Refactor: #issues_to_csv and #entries_to_csv merged into QueriesHelper#query_to_csv.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11448 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2013-02-23 11:07:43 +00:00
parent 9b1ebd6808
commit 797a9f1ea9
6 changed files with 34 additions and 44 deletions
+12 -7
View File
@@ -391,13 +391,18 @@ class IssuesControllerTest < ActionController::TestCase
end
def test_index_csv_with_description
get :index, :format => 'csv', :description => '1'
assert_response :success
assert_not_nil assigns(:issues)
assert_equal 'text/csv; header=present', @response.content_type
assert @response.body.starts_with?("#,")
lines = @response.body.chomp.split("\n")
assert_equal assigns(:query).columns.size + 1, lines[0].split(',').size
Issue.generate!(:description => 'test_index_csv_with_description')
with_settings :default_language => 'en' do
get :index, :format => 'csv', :description => '1'
assert_response :success
assert_not_nil assigns(:issues)
end
assert_equal 'text/csv; header=present', response.content_type
headers = response.body.chomp.split("\n").first.split(',')
assert_include 'Description', headers
assert_include 'test_index_csv_with_description', response.body
end
def test_index_csv_with_spent_time_column