/wheels/tests/model/onmissingmethod/hasMany/deleteobject.cfc
http://cfwheels.googlecode.com/ · ColdFusion CFScript · 19 lines · 16 code · 3 blank · 0 comment · 0 complexity · 54869a2ef95538a5d75cb06cf4c2c207 MD5 · raw file
- <cfcomponent extends="wheelsMapping.Test">
-
- <cffunction name="setup">
- <cfset loc.authorModel = model("author")>
- </cffunction>
-
- <cffunction name="test_deleteObject_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.deletePost(loc.post) />
- <cfset loc.post = model("post").findByKey(key=loc.post.id) />
- <cfset assert('loc.updated eq true')>
- <cfset assert('not IsObject(loc.post) and loc.post eq false')>
- <cftransaction action="rollback" />
- </cftransaction>
- </cffunction>
-
- </cfcomponent>