PageRenderTime 462ms CodeModel.GetById 171ms app.highlight 1ms RepoModel.GetById 177ms app.codeStats 0ms

/wheels/tests/view/assets/javaScriptIncludeTag.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 35 lines | 30 code | 5 blank | 0 comment | 0 complexity | 006e8e41a24fd634f68859f3b3e7ea9c 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.js,jquery.dataTables.min,jquery.dataTables.min.js">
10		<cfset loc.e = loc.controller.javaScriptIncludeTag(argumentcollection=loc.args)>
11		<cfset loc.r = '<script src="#application.wheels.webpath#javascripts/test.js" type="text/javascript"></script>#chr(10)#<script src="#application.wheels.webpath#javascripts/test.js" type="text/javascript"></script>#chr(10)#<script src="#application.wheels.webpath#javascripts/jquery.dataTables.min.js" type="text/javascript"></script>#chr(10)#<script src="#application.wheels.webpath#javascripts/jquery.dataTables.min.js" type="text/javascript"></script>#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.js.cfm">
19		<cfset loc.e = loc.controller.javaScriptIncludeTag(argumentcollection=loc.args)>
20		<cfset loc.r = '<script src="#application.wheels.webpath#javascripts/test.cfm" type="text/javascript"></script>#chr(10)#<script src="#application.wheels.webpath#javascripts/test.js.cfm" type="text/javascript"></script>#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/jquery/1.4.2/jquery.min.js,test,https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
28		<cfset loc.e = loc.controller.javaScriptIncludeTag(argumentcollection=loc.args)>
29		<cfset loc.r = '<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>#chr(10)#<script src="#application.wheels.webpath#javascripts/test.js" type="text/javascript"></script>#chr(10)#<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>#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>