Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date of promoted comment to answer adjusted #2229

Merged
merged 2 commits into from
Feb 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/controllers/comment_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand Down
6 changes: 3 additions & 3 deletions test/functional/comment_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down