test/test_model.rb in couchbase-model-0.5.0 vs test/test_model.rb in couchbase-model-0.5.1
- old
+ new
@@ -223,14 +223,16 @@
def test_validation
post = ValidPost.create(:title => 'Hello, World!')
assert post.valid?, "post with title should be valid"
post.title = nil
+ refute post.save
assert_raises(Couchbase::Error::RecordInvalid) do
- post.save
+ post.save!
end
+ refute ValidPost.create(:title => nil)
assert_raises(Couchbase::Error::RecordInvalid) do
- ValidPost.create(:title => nil)
+ ValidPost.create!(:title => nil)
end
end
def test_blob_documents
contents = File.read(__FILE__)