Sha256: beca8a29eddddfaf13990d17c1871def9d71fe7e975ecfc0b3a8fdd37d6e3c51
Contents?: true
Size: 740 Bytes
Versions: 89
Compression:
Stored size: 740 Bytes
Contents
require 'test_helper' class CassandraObject::ValidationsTest < CassandraObject::TestCase test 'create!' do begin Issue.validates(:description, :presence => true) Issue.create!(:description => 'lol') assert_raise(CassandraObject::RecordInvalid) { Issue.create!(:description => '') } ensure Issue.reset_callbacks(:validate) end end test 'validates :on' do begin Issue.validates(:description, :presence => true, :on => :create) issue = Issue.create!(:description => 'lol') issue.update_attributes! :description => nil assert_raise(CassandraObject::RecordInvalid) { Issue.create!(:description => '') } ensure Issue.reset_callbacks(:validate) end end end
Version data entries
89 entries across 89 versions & 1 rubygems