PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/wheels/tests/controller/miscellaneous/$performedRenderOrRedirect.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 44 lines | 38 code | 6 blank | 0 comment | 0 complexity | a1ed155808c690d71ccb5f07bc193023 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cfset variables.counter = 1>
 4
 5	<cffunction name="setup">
 6		<cfset params = {controller="dummy", action="dummy"}>
 7		<cfset loc.controller = controller("dummy", params)>
 8	</cffunction>
 9
10	<cffunction name="test_redirect_or_render_has_not_been_performed">
11		<cfset loc.e = false>
12		<cfset loc.r = loc.controller.$performedRedirect()>
13		<cfset assert('loc.e eq loc.r')>
14		<cfset loc.r = loc.controller.$performedRender()>
15		<cfset assert('loc.e eq loc.r')>
16		<cfset loc.r = loc.controller.$performedRenderOrRedirect()>
17		<cfset assert('loc.e eq loc.r')>
18	</cffunction>
19
20	<cffunction name="test_only_redirect_was_performed">
21		<cfset loc.controller.redirectTo(controller="wheels", action="wheels")>
22		<cfset loc.e = true>
23		<cfset loc.r = loc.controller.$performedRedirect()>
24		<cfset assert('loc.e eq loc.r')>
25		<cfset loc.r = loc.controller.$performedRenderOrRedirect()>
26		<cfset assert('loc.e eq loc.r')>
27		<cfset loc.e = false>
28		<cfset loc.r = loc.controller.$performedRender()>
29		<cfset assert('loc.e eq loc.r')>
30	</cffunction>
31
32	<cffunction name="test_only_render_was_performed">
33		<cfset loc.controller.renderNothing()>
34		<cfset loc.e = true>
35		<cfset loc.r = loc.controller.$performedRender()>
36		<cfset assert('loc.e eq loc.r')>
37		<cfset loc.r = loc.controller.$performedRenderOrRedirect()>
38		<cfset assert('loc.e eq loc.r')>
39		<cfset loc.e = false>
40		<cfset loc.r = loc.controller.$performedRedirect()>
41		<cfset assert('loc.e eq loc.r')>
42	</cffunction>
43
44</cfcomponent>