/wheels/tests/model/onmissingmethod/hasone/createobject.cfc
http://cfwheels.googlecode.com/ · ColdFusion CFScript · 17 lines · 14 code · 3 blank · 0 comment · 0 complexity · 4eb8a4f097204732a9a98023ea86b8ca MD5 · raw file
- <cfcomponent extends="wheelsMapping.Test">
-
- <cffunction name="setup">
- <cfset loc.authorModel = model("author")>
- </cffunction>
-
- <cffunction name="test_createObject_valid">
- <cfset loc.author = loc.authorModel.findOne(where="firstName = 'James'")>
- <cftransaction action="begin">
- <cfset loc.profile = loc.author.createProfile(dateOfBirth="1/1/1970", bio="Some profile.") />
- <cfset assert('IsObject(loc.profile) eq true')>
- <cfset assert('loc.profile.authorid eq loc.author.id')>
- <cftransaction action="rollback" />
- </cftransaction>
- </cffunction>
-
- </cfcomponent>