PageRenderTime 242ms CodeModel.GetById 120ms app.highlight 1ms RepoModel.GetById 120ms app.codeStats 0ms

/wheels/tests/view/miscellaneous/$addToJavaScriptAttribute.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 26 lines | 22 code | 4 blank | 0 comment | 0 complexity | 4c9ab7feeb04a6c29f54f7d52f1fb858 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		<cfset loc.args.name = "WheelsTesting">
 7		<cfset loc.args.content = "this is a test for the wheel's function $addToJavaScriptAttribute">
 8		<cfset loc.args.attributes = {}>
 9		<cfset loc.args.attributes.WheelsTesting = "testing">
10		<cfset loc.args.attributes.name = "javascripttag">
11	</cffunction>
12
13	<cffunction name="test_has_attribute_called_name">
14		<cfset loc.e = loc.controller.$addToJavaScriptAttribute(argumentcollection=loc.args)>
15		<cfset loc.r = "testing;#loc.args.content#">
16		<cfset assert("loc.e eq loc.r")>
17	</cffunction>
18
19	<cffunction name="test_does_not_have_attribute_called_name">
20		<cfset structdelete(loc.args.attributes, "WheelsTesting")>
21		<cfset loc.e = loc.controller.$addToJavaScriptAttribute(argumentcollection=loc.args)>
22		<cfset loc.r = loc.args.content>
23		<cfset assert("loc.e eq loc.r")>
24	</cffunction>
25
26</cfcomponent>