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

/wheels/tests/model/onmissingmethod/hasone/setobject.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 18 lines | 15 code | 3 blank | 0 comment | 0 complexity | 471aa5684526df0bf1e309c4e6410518 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_setObject_valid">
  6. <cfset loc.author = loc.authorModel.findOne(where="firstName = 'James'")>
  7. <cfset loc.profile = model("profile").findOne()>
  8. <cftransaction action="begin">
  9. <cfset loc.updated = loc.author.setProfile(loc.profile) />
  10. <cfset assert('loc.updated eq true')>
  11. <cfset assert('loc.profile.authorid eq loc.author.id')>
  12. <cftransaction action="rollback" />
  13. </cftransaction>
  14. </cffunction>
  15. </cfcomponent>