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

/wheels/tests/view/miscellaneous/resetcycle.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 30 lines | 26 code | 4 blank | 0 comment | 0 complexity | ff30b30ccddc768ac37b9012934c3696 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.values = "1,2,3,4,5,6">
 7		<cfset loc.args.name = "cycle_test_2">
 8		<cfset loc.container = listtoarray(loc.args.values)>
 9	</cffunction>
10
11	<cffunction name="test_named">
12		<cfloop array="#loc.container#" index="loc.r">
13			<cfset loc.controller.cycle(argumentcollection=loc.args)>
14		</cfloop>
15		<cfset assert("request.wheels.cycle[loc.args.name] eq 6")>
16		<cfset loc.controller.resetcycle(loc.args.name)>
17		<cfset assert("not structkeyexists(request.wheels.cycle, loc.args.name)")>
18	</cffunction>
19
20	<cffunction name="test_not_named">
21		<cfset structdelete(loc.args, "name")>
22		<cfloop array="#loc.container#" index="loc.r">
23			<cfset loc.controller.cycle(argumentcollection=loc.args)>
24		</cfloop>
25		<cfset assert("request.wheels.cycle['default'] eq 6")>
26		<cfset loc.controller.resetcycle()>
27		<cfset assert("not isdefined('request.wheels.cycle.default')")>
28	</cffunction>
29
30</cfcomponent>