Sha256: d7b5eba0473ca580fa37c8477a182556e3036feb6f870a634f4681b704dbacf6
Contents?: true
Size: 721 Bytes
Versions: 20
Compression:
Stored size: 721 Bytes
Contents
require 'test_helper' class CassandraObject::SavepointsTest < CassandraObject::TestCase test 'rollback create' do Issue.savepoint do issue = Issue.create description: 'foo' raise 'lol' end assert_nil Issue.first end test 'rollback update' do issue = Issue.create description: 'foo' Issue.savepoint do issue.update_attributes description: 'bar' raise 'lol' end issue = Issue.find issue.id assert_equal 'foo', issue.description end test 'rollback destroy' do issue = Issue.create description: 'foo' Issue.savepoint do issue.destroy raise 'lol' end assert_nothing_raised { Issue.find issue.id } end end
Version data entries
20 entries across 20 versions & 1 rubygems