/wheels/tests/model/onmissingmethod/hasone/deleteobject.cfc

http://cfwheels.googlecode.com/ · ColdFusion CFScript · 18 lines · 15 code · 3 blank · 0 comment · 0 complexity · dfab267143e83f0b55600bbdcec374a4 MD5 · raw file

  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="setup">
  3. <cfset loc.authorModel = model("author")>
  4. </cffunction>
  5. <cffunction name="test_deleteObject_valid">
  6. <cfset loc.author = loc.authorModel.findOne(where="firstName = 'Per'")>
  7. <cftransaction action="begin">
  8. <cfset loc.updated = loc.author.deleteProfile() />
  9. <cfset loc.profile = loc.author.profile()>
  10. <cfset assert('loc.updated eq true')>
  11. <cfset assert('loc.profile eq false')>
  12. <cftransaction action="rollback" />
  13. </cftransaction>
  14. </cffunction>
  15. </cfcomponent>