PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms 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
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.controller = controller(name="dummy")>
 5		<cfset loc.args = {}>
 6	</cffunction>
 7
 8	<cffunction name="test_should_handle_extensions_nonextensions_and_multiple_extensions">
 9		<cfset loc.args.source = "test,test.css,jquery.dataTables.min,jquery.dataTables.min.css">
10		<cfset loc.e = loc.controller.styleSheetLinkTag(argumentcollection=loc.args)>
11		<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)#'>
12		<cfset debug(expression='htmleditformat(loc.e)', display=false, format="text")>
13		<cfset debug(expression='htmleditformat(loc.r)', display=false, format="text")>
14		<cfset assert("loc.e eq loc.r")>
15	</cffunction>
16
17	<cffunction name="test_no_automatic_extention_when_cfm">
18		<cfset loc.args.source = "test.cfm,test.css.cfm">
19		<cfset loc.e = loc.controller.styleSheetLinkTag(argumentcollection=loc.args)>
20		<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)#'>
21		<cfset debug(expression='htmleditformat(loc.e)', display=false, format="text")>
22		<cfset debug(expression='htmleditformat(loc.r)', display=false, format="text")>
23		<cfset assert("loc.e eq loc.r")>
24	</cffunction>
25
26	<cffunction name="test_support_external_links">
27		<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">
28		<cfset loc.e = loc.controller.styleSheetLinkTag(argumentcollection=loc.args)>
29		<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)#'>
30		<cfset debug(expression='htmleditformat(loc.e)', display=false, format="text")>
31		<cfset debug(expression='htmleditformat(loc.r)', display=false, format="text")>
32		<cfset assert("loc.e eq loc.r")>
33	</cffunction>
34
35</cfcomponent>