/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

  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="setup">
  3. <cfset loc.authorModel = model("author")>
  4. </cffunction>
  5. <cffunction name="test_createObject_valid">
  6. <cfset loc.author = loc.authorModel.findOne(where="firstName = 'James'")>
  7. <cftransaction action="begin">
  8. <cfset loc.profile = loc.author.createProfile(dateOfBirth="1/1/1970", bio="Some profile.") />
  9. <cfset assert('IsObject(loc.profile) eq true')>
  10. <cfset assert('loc.profile.authorid eq loc.author.id')>
  11. <cftransaction action="rollback" />
  12. </cftransaction>
  13. </cffunction>
  14. </cfcomponent>