/wheels/tests/model/onmissingmethod/hasMany/removeobject.cfc
ColdFusion CFScript | 19 lines | 16 code | 3 blank | 0 comment | 0 complexity | 16e22bf51ae9b9af68903684428a2e0c MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
- <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.post = loc.author.findOnePost(order="id")>
- <cftransaction action="begin">
- <cfset loc.updated = loc.author.removePost(loc.post) />
- <cfset loc.post.reload() />
- <cfset assert('loc.updated eq true')>
- <cfset assert('loc.post.authorid eq ""')>
- <cftransaction action="rollback" />
- </cftransaction>
- </cffunction>
-
- </cfcomponent>