PageRenderTime 78ms CodeModel.GetById 33ms app.highlight 1ms RepoModel.GetById 15ms app.codeStats 0ms

/wheels/tests/controller/miscellaneous/helpers.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 29 lines | 24 code | 5 blank | 0 comment | 0 complexity | 51acc4e579ca62b7f945a827b084ebe3 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfif StructKeyExists(request, "test")>
 5			<cfset StructDelete(request, "test")>
 6		</cfif>
 7		<cfset oldViewPath = application.wheels.viewPath>
 8		<cfset application.wheels.viewPath = "wheels/tests/_assets/views">
 9		<cfset application.wheels.existingHelperFiles = "test">
10		<cfset params = {controller="test", action="helperCaller"}>
11		<cfset loc.controller = controller("test", params)>
12	</cffunction>
13	
14	<cffunction name="test_inclusion_of_global_helper_file">
15		<cfset loc.controller.renderPage()>
16		<cfset assert("StructKeyExists(request.test, 'globalHelperFunctionWasCalled')")>
17	</cffunction>
18	
19	<cffunction name="test_inclusion_of_controller_helper_file">
20		<cfset loc.controller.renderPage()>
21		<cfset assert("StructKeyExists(request.test, 'controllerHelperFunctionWasCalled')")>
22	</cffunction>
23
24	<cffunction name="teardown">
25		<cfset application.wheels.viewPath = oldViewPath>
26		<cfset application.wheels.existingHelperFiles = "">
27	</cffunction>
28
29</cfcomponent>