PageRenderTime 193ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/model/_query/order.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 24 lines | 20 code | 4 blank | 0 comment | 0 complexity | bad1bd7dd6828ea95cb1d1e44bcdf45c 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_set_order">
  6. <cfset loc.authorModel.order("id")>
  7. <cfset loc.orderData = loc.authorModel.toQuery().order[1]>
  8. <cfset assert('loc.orderData.property eq "id"')>
  9. <cfset assert('loc.orderData.direction eq "ASC"')>
  10. </cffunction>
  11. <cffunction name="test_set_order_multiple_times">
  12. <cfset loc.authorModel.order("id").order("authorid", "desc")>
  13. <cfset loc.order1Data = loc.authorModel.toQuery().order[1]>
  14. <cfset loc.order2Data = loc.authorModel.toQuery().order[2]>
  15. <cfset assert('loc.order1Data.property eq "id"')>
  16. <cfset assert('loc.order1Data.direction eq "ASC"')>
  17. <cfset assert('loc.order2Data.property eq "authorid"')>
  18. <cfset assert('loc.order2Data.direction eq "DESC"')>
  19. </cffunction>
  20. </cfcomponent>