PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/wheels/tests/controller/rendering/renderpage.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 38 lines | 29 code | 9 blank | 0 comment | 0 complexity | a07562219fb1f241dc26d37035f90519 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cfinclude template="setupAndTeardown.cfm">
 4
 5	<cfset params = {controller="test", action="test"}>
 6	<cfset loc.controller = controller("test", params)>
 7
 8	<cffunction name="test_rendering_current_action">
 9		<cfset result = loc.controller.renderPage()>
10		<cfset assert("loc.controller.response() Contains 'view template content'")>
11	</cffunction>
12
13	<cffunction name="test_rendering_view_for_another_controller_and_action">
14		<cfset result = loc.controller.renderPage(controller="main", action="template")>
15		<cfset assert("loc.controller.response() Contains 'main controller template content'")>
16	</cffunction>
17
18	<cffunction name="test_rendering_view_for_another_action">
19		<cfset result = loc.controller.renderPage(action="template")>
20		<cfset assert("loc.controller.response() Contains 'specific template content'")>
21	</cffunction>
22
23	<cffunction name="test_rendering_specific_template">
24		<cfset result = loc.controller.renderPage(template="template")>
25		<cfset assert("loc.controller.response() Contains 'specific template content'")>
26	</cffunction>
27
28	<cffunction name="test_rendering_and_returning_as_string">
29		<cfset result = loc.controller.renderPage(returnAs="string")>
30		<cfset assert("NOT StructKeyExists(request.wheels, 'response') AND result Contains 'view template content'")>
31	</cffunction>
32	
33	<cffunction name="test_rendering_with_cfthread_in_view">
34		<cfset result = loc.controller.renderPage(action="withthread")>
35		<cfset assert("loc.controller.response() Contains '1|Per|Djurner'")>
36	</cffunction>
37
38</cfcomponent>