PageRenderTime 34ms CodeModel.GetById 8ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/view/urls/buttonTo.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 28 lines | 23 code | 5 blank | 0 comment | 0 complexity | e86f042e1454047d0912d85881898306 MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="setup">
  3. <cfset loc.controller = controller(name="dummy")>
  4. <cfset oldURLRewriting = application.wheels.URLRewriting>
  5. <cfset application.wheels.URLRewriting = "On">
  6. <cfset oldScriptName = request.cgi.script_name>
  7. <cfset request.cgi.script_name = "/rewrite.cfm">
  8. </cffunction>
  9. <cffunction name="teardown">
  10. <cfset application.wheels.URLRewriting = oldURLRewriting>
  11. <cfset request.cgi.script_name = oldScriptName>
  12. </cffunction>
  13. <cffunction name="test_confirm_is_escaped">
  14. <cfset loc.e = '<form action="#application.wheels.webpath#" method="post"><input data-confirm="Mark as: \''Completed\''?" type="submit" value="" /></form>'>
  15. <cfset loc.r = loc.controller.buttonTo(confirm="Mark as: 'Completed'?")>
  16. <cfset assert('loc.e eq loc.r')>
  17. </cffunction>
  18. <cffunction name="test_disabled_is_escaped">
  19. <cfset loc.e = '<form action="#application.wheels.webpath#" method="post"><input data-disable-with="Mark as: \''Completed\''?" type="submit" value="" /></form>'>
  20. <cfset loc.r = loc.controller.buttonTo(disable="Mark as: 'Completed'?")>
  21. <cfset assert('loc.e eq loc.r')>
  22. </cffunction>
  23. </cfcomponent>