diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-12-12 20:04:25 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-12-12 20:04:25 +0000 |
commit | f05f3b50c872848e2e71b591cf3aa4bc64462abf (patch) | |
tree | 7ab7b942331003cc240f4348c049ae1045b3935c /test/test_helper.rb | |
parent | e647e99b741ce0360ee479925009076f48d0d8a5 (diff) | |
download | redmine-f05f3b50c872848e2e71b591cf3aa4bc64462abf.tar.gz redmine-f05f3b50c872848e2e71b591cf3aa4bc64462abf.zip |
Test failure.
git-svn-id: http://svn.redmine.org/redmine/trunk@17725 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r-- | test/test_helper.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb index 796daf268..ef8215cc1 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -41,6 +41,10 @@ Redmine::SudoMode.disable! $redmine_tmp_attachments_directory = "#{Rails.root}/tmp/test/attachments" FileUtils.mkdir_p $redmine_tmp_attachments_directory +$redmine_tmp_pdf_directory = "#{Rails.root}/tmp/test/pdf" +FileUtils.mkdir_p $redmine_tmp_pdf_directory +FileUtils.rm Dir.glob('#$redmine_tmp_pdf_directory/*.pdf') + class ActionView::TestCase helper :application include ApplicationHelper @@ -329,6 +333,15 @@ module Redmine end assert_equal expected_filters.size, filter_init.scan("addFilter").size, "filters counts don't match" end + + # Saves the generated PDF in tmp/test/pdf + def save_pdf + assert_equal 'application/pdf', response.content_type + filename = "#{self.class.name.underscore}__#{method_name}.pdf" + File.open(File.join($redmine_tmp_pdf_directory, filename), "wb") do |f| + f.write response.body + end + end end class RepositoryControllerTest < ControllerTest |