diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-12-08 17:30:47 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-12-08 17:30:47 +0000 |
commit | 95810125bf1d3afe7803df2d812de6af1837ef62 (patch) | |
tree | b95e88fd68d1802d285454c6a651807350744f87 | |
parent | 2462a8581de0090d609a45b0169890c052b15c3f (diff) | |
download | redmine-95810125bf1d3afe7803df2d812de6af1837ef62.tar.gz redmine-95810125bf1d3afe7803df2d812de6af1837ef62.zip |
Don't create a journal when creating an issue with attachments.
git-svn-id: http://svn.redmine.org/redmine/trunk@13733 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/issues_controller.rb | 2 | ||||
-rw-r--r-- | test/functional/issues_controller_test.rb | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index ff04d0504..11b25435c 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -407,9 +407,9 @@ class IssuesController < ApplicationController def build_new_issue_from_params if params[:id].blank? @issue = Issue.new - @issue.init_journal(User.current) if params[:copy_from] begin + @issue.init_journal(User.current) @copy_from = Issue.visible.find(params[:copy_from]) @link_copy = link_copy?(params[:link_copy]) || request.get? @copy_attachments = params[:copy_attachments].present? || request.get? diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 91a9bc6e8..75368d9f9 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2225,9 +2225,11 @@ class IssuesControllerTest < ActionController::TestCase assert_difference 'Issue.count' do assert_difference 'Attachment.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'}} + assert_no_difference 'Journal.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 end |