Patch #43289 » fix-news-comments_count.patch
| test/fixtures/news.yml | ||
|---|---|---|
|
Visit http://ecookbook.somenet.foo/
|
||
|
summary: First version was released...
|
||
|
author_id: 2
|
||
|
comments_count: 1
|
||
|
comments_count: 2
|
||
|
news_002:
|
||
|
created_on: 2006-07-19 22:42:58 +02:00
|
||
|
project_id: 1
|
||
| test/unit/comment_test.rb | ||
|---|---|---|
|
comment = Comment.new(:commented => @news, :author => @jsmith, :comments => "my comment")
|
||
|
assert comment.save
|
||
|
@news.reload
|
||
|
assert_equal 2, @news.comments_count
|
||
|
assert_equal 3, @news.comments_count
|
||
|
end
|
||
|
def test_create_should_send_notification
|
||
| ... | ... | |
|
comment = Comment.find(1)
|
||
|
assert comment.destroy
|
||
|
@news.reload
|
||
|
assert_equal 0, @news.comments_count
|
||
|
assert_equal 1, @news.comments_count
|
||
|
end
|
||
|
end
|
||