mirror of
https://github.com/redmine/redmine.git
synced 2025-11-02 19:36:00 +01:00
Incorrect comments_count value in News fixture for news_001 (#43289).
Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@24028 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
2
test/fixtures/news.yml
vendored
2
test/fixtures/news.yml
vendored
@@ -10,7 +10,7 @@ news_001:
|
|||||||
Visit http://ecookbook.somenet.foo/
|
Visit http://ecookbook.somenet.foo/
|
||||||
summary: First version was released...
|
summary: First version was released...
|
||||||
author_id: 2
|
author_id: 2
|
||||||
comments_count: 1
|
comments_count: 2
|
||||||
news_002:
|
news_002:
|
||||||
created_on: 2006-07-19 22:42:58 +02:00
|
created_on: 2006-07-19 22:42:58 +02:00
|
||||||
project_id: 1
|
project_id: 1
|
||||||
|
|||||||
@@ -27,10 +27,11 @@ class CommentTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_create
|
def test_create
|
||||||
|
assert_difference '@news.comments_count', 1 do
|
||||||
comment = Comment.new(:commented => @news, :author => @jsmith, :comments => "my comment")
|
comment = Comment.new(:commented => @news, :author => @jsmith, :comments => "my comment")
|
||||||
assert comment.save
|
assert comment.save
|
||||||
@news.reload
|
@news.reload
|
||||||
assert_equal 2, @news.comments_count
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_create_should_send_notification
|
def test_create_should_send_notification
|
||||||
@@ -50,9 +51,10 @@ class CommentTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_destroy
|
def test_destroy
|
||||||
|
assert_difference '@news.comments_count', -1 do
|
||||||
comment = Comment.find(1)
|
comment = Comment.find(1)
|
||||||
assert comment.destroy
|
assert comment.destroy
|
||||||
@news.reload
|
@news.reload
|
||||||
assert_equal 0, @news.comments_count
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user