diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-05-17 16:51:09 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-05-17 16:51:09 +0000 |
commit | d6789593597694e78c4b2c5f40fe63cef3c48002 (patch) | |
tree | 12de16a8916bf2289dec6baef2ed78d86cbe1890 /test/functional | |
parent | 8bbc6d251e7a22ec9bf8877162035e30c247f418 (diff) | |
download | redmine-d6789593597694e78c4b2c5f40fe63cef3c48002.tar.gz redmine-d6789593597694e78c4b2c5f40fe63cef3c48002.zip |
Add links to attachments in new issue email notification (#12293).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11853 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/issues_controller_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index b0dc58634..243ff83c9 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2159,6 +2159,25 @@ class IssuesControllerTest < ActionController::TestCase assert_equal 59, File.size(attachment.diskfile) end + def test_post_create_with_attachment_should_notify_with_attachments + ActionMailer::Base.deliveries.clear + set_tmp_attachments_directory + @request.session[:user_id] = 2 + + with_settings :host_name => 'mydomain.foo', :protocol => 'http' do + assert_difference 'Issue.count' do + post :create, :project_id => 1, + :issue => { :tracker_id => '1', :subject => 'With attachment' }, + :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}} + end + end + + assert_not_nil ActionMailer::Base.deliveries.last + assert_select_email do + assert_select 'a[href^=?]', 'http://mydomain.foo/attachments/download', 'testfile.txt' + end + end + def test_post_create_with_failure_should_save_attachments set_tmp_attachments_directory @request.session[:user_id] = 2 |