PageRenderTime 49ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/view/assets/styleSheetLinkTag.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 35 lines | 30 code | 5 blank | 0 comment | 0 complexity | 0a4f6433fd3b1f6d97bf74b3f95cc047 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 loc.args = {}>
  5. </cffunction>
  6. <cffunction name="test_should_handle_extensions_nonextensions_and_multiple_extensions">
  7. <cfset loc.args.source = "test,test.css,jquery.dataTables.min,jquery.dataTables.min.css">
  8. <cfset loc.e = loc.controller.styleSheetLinkTag(argumentcollection=loc.args)>
  9. <cfset loc.r = '<link href="#application.wheels.webpath#stylesheets/test.css" media="all" rel="stylesheet" type="text/css" />#chr(10)#<link href="#application.wheels.webpath#stylesheets/test.css" media="all" rel="stylesheet" type="text/css" />#chr(10)#<link href="#application.wheels.webpath#stylesheets/jquery.dataTables.min.css" media="all" rel="stylesheet" type="text/css" />#chr(10)#<link href="#application.wheels.webpath#stylesheets/jquery.dataTables.min.css" media="all" rel="stylesheet" type="text/css" />#chr(10)#'>
  10. <cfset debug(expression='htmleditformat(loc.e)', display=false, format="text")>
  11. <cfset debug(expression='htmleditformat(loc.r)', display=false, format="text")>
  12. <cfset assert("loc.e eq loc.r")>
  13. </cffunction>
  14. <cffunction name="test_no_automatic_extention_when_cfm">
  15. <cfset loc.args.source = "test.cfm,test.css.cfm">
  16. <cfset loc.e = loc.controller.styleSheetLinkTag(argumentcollection=loc.args)>
  17. <cfset loc.r = '<link href="#application.wheels.webpath#stylesheets/test.cfm" media="all" rel="stylesheet" type="text/css" />#chr(10)#<link href="#application.wheels.webpath#stylesheets/test.css.cfm" media="all" rel="stylesheet" type="text/css" />#chr(10)#'>
  18. <cfset debug(expression='htmleditformat(loc.e)', display=false, format="text")>
  19. <cfset debug(expression='htmleditformat(loc.r)', display=false, format="text")>
  20. <cfset assert("loc.e eq loc.r")>
  21. </cffunction>
  22. <cffunction name="test_support_external_links">
  23. <cfset loc.args.source = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/start/jquery-ui.css,test.css,https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/start/jquery-ui.css">
  24. <cfset loc.e = loc.controller.styleSheetLinkTag(argumentcollection=loc.args)>
  25. <cfset loc.r = '<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/start/jquery-ui.css" media="all" rel="stylesheet" type="text/css" />#chr(10)#<link href="#application.wheels.webpath#stylesheets/test.css" media="all" rel="stylesheet" type="text/css" />#chr(10)#<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/start/jquery-ui.css" media="all" rel="stylesheet" type="text/css" />#chr(10)#'>
  26. <cfset debug(expression='htmleditformat(loc.e)', display=false, format="text")>
  27. <cfset debug(expression='htmleditformat(loc.r)', display=false, format="text")>
  28. <cfset assert("loc.e eq loc.r")>
  29. </cffunction>
  30. </cfcomponent>