##// END OF EJS Templates
Don't create a journal when creating an issue with attachments....
Jean-Philippe Lang -
r13351:95810125bf1d
parent child
Show More
@@ -407,9 +407,9 class IssuesController < ApplicationController
407 def build_new_issue_from_params
407 def build_new_issue_from_params
408 if params[:id].blank?
408 if params[:id].blank?
409 @issue = Issue.new
409 @issue = Issue.new
410 @issue.init_journal(User.current)
411 if params[:copy_from]
410 if params[:copy_from]
412 begin
411 begin
412 @issue.init_journal(User.current)
413 @copy_from = Issue.visible.find(params[:copy_from])
413 @copy_from = Issue.visible.find(params[:copy_from])
414 @link_copy = link_copy?(params[:link_copy]) || request.get?
414 @link_copy = link_copy?(params[:link_copy]) || request.get?
415 @copy_attachments = params[:copy_attachments].present? || request.get?
415 @copy_attachments = params[:copy_attachments].present? || request.get?
@@ -2225,9 +2225,11 class IssuesControllerTest < ActionController::TestCase
2225
2225
2226 assert_difference 'Issue.count' do
2226 assert_difference 'Issue.count' do
2227 assert_difference 'Attachment.count' do
2227 assert_difference 'Attachment.count' do
2228 post :create, :project_id => 1,
2228 assert_no_difference 'Journal.count' do
2229 :issue => { :tracker_id => '1', :subject => 'With attachment' },
2229 post :create, :project_id => 1,
2230 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}}
2230 :issue => { :tracker_id => '1', :subject => 'With attachment' },
2231 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}}
2232 end
2231 end
2233 end
2232 end
2234 end
2233
2235
General Comments 0
You need to be logged in to leave comments. Login now