PageRenderTime 21ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/model/onmissingmethod/hasMany/newobject.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 14 lines | 11 code | 3 blank | 0 comment | 0 complexity | c41cd0532eb68ec3b734117f80d6670c MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="setup">
  3. <cfset loc.authorModel = model("author")>
  4. </cffunction>
  5. <cffunction name="test_newObject_valid">
  6. <cfset loc.author = loc.authorModel.findOne(where="firstName = 'James'")>
  7. <cfset loc.post = loc.author.newPost() />
  8. <cfset assert('IsObject(loc.post) eq true')>
  9. <cfset assert('loc.post.authorid eq loc.author.id')>
  10. </cffunction>
  11. </cfcomponent>