From e180618aede894260c6ef77fbc73a9d00a2f95b4 Mon Sep 17 00:00:00 2001 From: gauravano Date: Mon, 5 Feb 2018 12:44:08 +0530 Subject: [PATCH 1/2] time change , mailer remove and test update --- app/controllers/comment_controller.rb | 5 +++-- test/functional/comment_controller_test.rb | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb index 88e10ec6f2..ed44dc5538 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 b1696d4a93..7c9f382dc7 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 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 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 end test 'render propose title template when author is logged in' do From e51973ca1628b5f40c8a528002e9a42482fb8510 Mon Sep 17 00:00:00 2001 From: gauravano Date: Mon, 5 Feb 2018 23:35:03 +0530 Subject: [PATCH 2/2] comments addition in test --- test/functional/comment_controller_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/comment_controller_test.rb b/test/functional/comment_controller_test.rb index 7c9f382dc7..efccc13624 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_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_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_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