/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
- <cfcomponent extends="wheelsMapping.Test">
-
- <cffunction name="setup">
- <cfset loc.authorModel = model("author")>
- </cffunction>
-
- <cffunction name="test_removeObject_valid">
- <cfset loc.author = loc.authorModel.findOne(where="firstName = 'Per'")>
- <cfset loc.profile = loc.author.profile()>
- <cftransaction action="begin">
- <cfset loc.updated = loc.author.removeProfile() />
- <cfset loc.profile.reload() />
- <cfset assert('loc.updated eq true')>
- <cfset assert('loc.profile.authorid eq ""')>
- <cftransaction action="rollback" />
- </cftransaction>
- </cffunction>
-
- </cfcomponent>