diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb index 88e10ec6f22..ed44dc55384 100644 --- a/app/controllers/comment_controller.rb +++ b/app/controllers/comment_controller.rb @@ -154,11 +154,12 @@ def make_answer @answer = Answer.new( nid: @comment.nid, uid: @comment.uid, - content: @comment.comment + content: @comment.comment, + created_at: @comment.created_at, + updated_at: @comment.created_at ) if @answer.save && @comment.delete - @answer.answer_notify(current_user) @answer_id = @comment.aid respond_with do |format| format.js { render template: 'comment/make_answer' } diff --git a/test/functional/comment_controller_test.rb b/test/functional/comment_controller_test.rb index b1696d4a933..efccc136248 100644 --- a/test/functional/comment_controller_test.rb +++ b/test/functional/comment_controller_test.rb @@ -315,7 +315,7 @@ def teardown id: comment.id end assert_not_nil :answer - assert_not_equal initial_mail_count, ActionMailer::Base.deliveries.size + assert_equal initial_mail_count, ActionMailer::Base.deliveries.size # check for ensuring that no Email is sent end test 'should create answer while promoting comment if user is moderator' do @@ -327,7 +327,7 @@ def teardown id: comment.id end assert_not_nil :answer - assert_not_equal initial_mail_count, ActionMailer::Base.deliveries.size + assert_equal initial_mail_count, ActionMailer::Base.deliveries.size # check for ensuring that no Email is sent end test 'should create answer while promoting comment if user is admin' do @@ -339,7 +339,7 @@ def teardown id: comment.id end assert_not_nil :answer - assert_not_equal initial_mail_count, ActionMailer::Base.deliveries.size + assert_equal initial_mail_count, ActionMailer::Base.deliveries.size # check for ensuring that no Email is sent end test 'render propose title template when author is logged in' do