summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/functional/issues_controller_test.rb5
-rw-r--r--test/test_helper.rb13
2 files changed, 17 insertions, 1 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 044cc0c54..91b3efa82 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -43,7 +43,8 @@ class IssuesControllerTest < Redmine::ControllerTest
:journal_details,
:queries,
:repositories,
- :changesets
+ :changesets,
+ :watchers
include Redmine::I18n
@@ -5716,6 +5717,8 @@ class IssuesControllerTest < Redmine::ControllerTest
}
}
assert_response 302
+ # 4 emails for 2 members and 2 issues
+ # 1 email for a watcher of issue #2
assert_equal 5, ActionMailer::Base.deliveries.size
end
end
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