add controller tests
This commit is contained in:
@@ -2,14 +2,14 @@ require "test_helper"
|
||||
|
||||
class CommentTest < ActiveSupport::TestCase
|
||||
test "should be valid with a user, body, and commentable" do
|
||||
user = users(:one)
|
||||
user = users(:admin_user)
|
||||
entry = entries(:one)
|
||||
comment = Comment.new(user: user, body: "This is a comment.", commentable: entry)
|
||||
assert comment.valid?
|
||||
end
|
||||
|
||||
test "should be invalid without a body" do
|
||||
user = users(:one)
|
||||
user = users(:admin_user)
|
||||
entry = entries(:one)
|
||||
comment = Comment.new(user: user, commentable: entry)
|
||||
assert_not comment.valid?
|
||||
@@ -22,7 +22,7 @@ class CommentTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
test "should be invalid without a commentable" do
|
||||
user = users(:one)
|
||||
user = users(:admin_user)
|
||||
comment = Comment.new(user: user, body: "This is a comment.")
|
||||
assert_not comment.valid?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user