PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/wheels/tests/controller/request/pagination.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 27 lines | 21 code | 6 blank | 0 comment | 0 complexity | 45b38e1e0bf80a51107f188c3bc7aea1 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2	
 3	<cfset params = {controller="dummy", action="dummy"}>
 4	<cfset loc.controller = controller("dummy", params)>
 5	
 6	<cffunction name="setup">
 7		<cfset request.wheels["myhandle"] = {test="true"}>
 8	</cffunction>
 9	
10	<cffunction name="teardown">
11		<cfset structdelete(request.wheels, "myhandle", false)>
12	</cffunction>
13
14	<cffunction name="test_pagination_handle_exists">
15		<cfset loc.r = loc.controller.pagination('myhandle')>
16		<cfset assert('isstruct(loc.r)')>
17		<cfset assert('structkeyexists(loc.r, "test")')>
18		<cfset assert('loc.r.test eq true')>
19	</cffunction>
20	
21	<cffunction name="test_pagination_handle_does_not_exists">
22		<cfset loc.e = "Wheels.QueryHandleNotFound">
23		<cfset loc.r = raised('loc.controller.pagination("someotherhandle")')>
24		<cfset assert('loc.e eq loc.r')>
25	</cffunction>
26
27</cfcomponent>