PageRenderTime 47ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://cfwheels.googlecode.com/
ColdFusion CFScript | 26 lines | 21 code | 5 blank | 0 comment | 0 complexity | d4a859d852b0c31bfffbe7a049a1e74c 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. <cfset loc.userModel = model("user")>
  5. </cffunction>
  6. <cffunction name="test_object_valid">
  7. <cfset loc.author = loc.authorModel.findOne(where="firstName = 'Per'")>
  8. <cfset loc.profile = loc.author.profile() />
  9. <cfset assert('IsObject(loc.profile) eq true')>
  10. </cffunction>
  11. <cffunction name="test_object_valid_with_combi_key">
  12. <cfset loc.user = loc.userModel.findByKey(key=1)>
  13. <cfset loc.combiKey = loc.user.combiKey() />
  14. <cfset assert('IsObject(loc.combiKey) eq true')>
  15. </cffunction>
  16. <cffunction name="test_object_returns_false">
  17. <cfset loc.author = loc.authorModel.findOne(where="firstName = 'James'")>
  18. <cfset loc.profile = loc.author.profile() />
  19. <cfset assert('IsObject(loc.profile) eq false')>
  20. </cffunction>
  21. </cfcomponent>