I have a model:
class Property < ActiveRecord::Base
# assumption exists only if property does
has_one :assumption, :dependent => true
class Assumption < ActiveRecord::Base
belongs_to :property
My property test case for destroy is:
assert @property.destroy()
assert_raise(ActiveRecord::RecordNotFound){
Property.find(1) # passes
}
assert_raise(ActiveRecord::RecordNotFound){
Assumption.find_by_property(1) # fails
}
I can see from the SQL that the ''assumption'' is being deleted,
and the
objects are being set to nil, but ActiveRecord is not raising an exception.
Is there a flaw in my test logic?
Thanks.