3 class ChangesetCommentTest < ActiveSupport::TestCase
4 fixtures :changesets, :changeset_comments
6 def test_changeset_comment_count
7 assert_equal 4, ChangesetComment.count
11 def test_does_not_accept_invalid_author
12 comment = changeset_comments(:normal_comment_1)
15 assert !comment.valid?
17 comment.author_id = 999111
18 assert !comment.valid?
21 def test_does_not_accept_invalid_changeset
22 comment = changeset_comments(:normal_comment_1)
24 comment.changeset = nil
25 assert !comment.valid?
27 comment.changeset_id = 999111
28 assert !comment.valid?
31 def test_does_not_accept_empty_visible
32 comment = changeset_comments(:normal_comment_1)
35 assert !comment.valid?
38 def test_comments_of_changeset_count
39 assert_equal 3, Changeset.find(changesets(:normal_user_closed_change).id).comments.count