/wheels/tests/model/onmissingmethod/hasone/createobject.cfc
ColdFusion CFScript | 17 lines | 14 code | 3 blank | 0 comment | 0 complexity | 4eb8a4f097204732a9a98023ea86b8ca MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
1<cfcomponent extends="wheelsMapping.Test"> 2 3 <cffunction name="setup"> 4 <cfset loc.authorModel = model("author")> 5 </cffunction> 6 7 <cffunction name="test_createObject_valid"> 8 <cfset loc.author = loc.authorModel.findOne(where="firstName = 'James'")> 9 <cftransaction action="begin"> 10 <cfset loc.profile = loc.author.createProfile(dateOfBirth="1/1/1970", bio="Some profile.") /> 11 <cfset assert('IsObject(loc.profile) eq true')> 12 <cfset assert('loc.profile.authorid eq loc.author.id')> 13 <cftransaction action="rollback" /> 14 </cftransaction> 15 </cffunction> 16 17</cfcomponent>