tests: fix broken tests.

This commit is contained in:
evazion
2020-08-05 12:41:17 -05:00
parent 56a4e58510
commit e31afd0827
3 changed files with 9 additions and 5 deletions

View File

@@ -142,9 +142,11 @@ class PostTest < ActiveSupport::TestCase
end
should "fail" do
@post.delete!("test")
assert_equal(["Is status locked ; cannot delete post"], @post.errors.full_messages)
assert_equal(1, Post.where("id = ?", @post.id).count)
assert_raise(ActiveRecord::RecordInvalid) do
@post.delete!("test")
end
assert_equal(false, @post.reload.is_deleted?)
end
end