spec/cql/model/persistence_spec.rb in cql_model-0.0.3 vs spec/cql/model/persistence_spec.rb in cql_model-0.0.4
- old
+ new
@@ -21,13 +21,26 @@
@person.save
@person.persisted?.must_equal true
end
end
- describe '#update_attribute' do
+ describe '#delete' do
+ before :each do
+ @person.save
+ end
- end
+ it { @person.delete.must_be_instance_of Person }
- describe '#update_attributes' do
+ it do
+ @person.deleted?.must_equal false
+ @person.persisted?.must_equal true
+ @person.delete
+ @person.deleted?.must_equal true
+ @person.persisted?.must_equal false
+ end
+ it do
+ @person.delete
+ Person.find(123).must_be_nil
+ end
end
end