update factories + tests

This commit is contained in:
Albert Yi
2019-05-10 17:31:07 -07:00
parent 32b4e0a01e
commit 04edc3f533
26 changed files with 81 additions and 83 deletions

View File

@@ -89,7 +89,8 @@ class CommentTest < ActiveSupport::TestCase
end
should "fail creation" do
comment = FactoryBot.build(:comment)
post = FactoryBot.create(:post)
comment = FactoryBot.build(:comment, post: post)
comment.save
assert_equal(["You can not post comments within 1 week of sign up"], comment.errors.full_messages)
end