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

http://cfwheels.googlecode.com/ · ColdFusion CFScript · 19 lines · 16 code · 3 blank · 0 comment · 0 complexity · 4f2bc3672d8939998128b7843e54e3cf MD5 · raw file

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