PageRenderTime 23ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/model/crud/where.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 31 lines | 26 code | 5 blank | 0 comment | 0 complexity | 51fd52c5bb2950af76a74e5119f40773 MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <!--- <cffunction name="test_contains_multiple_spaces_tabs_and_carriage_returns">
  3. <cfset loc.r = model("post").findAll(where="views
  4. >=
  5. 5 AND
  6. averagerating
  7. >
  8. 3")>
  9. <cfset assert('loc.r.recordcount eq 1')>
  10. </cffunction> --->
  11. <cffunction name="test_should_not_strip_extra_whitespace_from_values">
  12. <cfset loc.r = model("user").findAll(where="address = '123 Petruzzi St.'")>
  13. <cfset assert('loc.r.recordcount eq 0')>
  14. <cfset loc.r = model("user").findAll(where="address = '123 Petruzzi St.'")>
  15. <cfset assert('loc.r.recordcount eq 2')>
  16. </cffunction>
  17. <cffunction name="test_in_statement_should_not_error">
  18. <cfset loc.r = model("user").findAll(where="username IN('tonyp','perd','chrisp') AND (firstname = 'Tony' OR firstname = 'Per' OR firstname = 'Chris') OR id IN(1,2,3)")>
  19. <cfset assert('loc.r.recordcount eq 3')>
  20. </cffunction>
  21. <cffunction name="test_in_statement_respect_parenthesis_commas_and_single_quotes">
  22. <cfset loc.r = model("user").findAll(where="username IN('tony''s','pe''(yo,yo)rd','chrisp')")>
  23. <cfset assert('loc.r.recordcount eq 1')>
  24. </cffunction>
  25. </cfcomponent>