Project

General

Profile

Patch #43289 » fix-news-comments_count-v2.patch

Go MAEDA, 2025-10-05 03:41

View differences:

test/unit/comment_test.rb
end
def test_create
comment = Comment.new(:commented => @news, :author => @jsmith, :comments => "my comment")
assert comment.save
@news.reload
assert_equal 2, @news.comments_count
assert_difference '@news.comments_count', 1 do
comment = Comment.new(:commented => @news, :author => @jsmith, :comments => "my comment")
assert comment.save
@news.reload
end
end
def test_create_should_send_notification
......
end
def test_destroy
comment = Comment.find(1)
assert comment.destroy
@news.reload
assert_equal 0, @news.comments_count
assert_difference '@news.comments_count', -1 do
comment = Comment.find(1)
assert comment.destroy
@news.reload
end
end
end
(4-4/4)