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

/wheels/tests/model/_query/order.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 24 lines | 20 code | 4 blank | 0 comment | 0 complexity | bad1bd7dd6828ea95cb1d1e44bcdf45c MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.authorModel = model("author")>
 5	</cffunction>
 6
 7	<cffunction name="test_set_order">
 8		<cfset loc.authorModel.order("id")>
 9		<cfset loc.orderData = loc.authorModel.toQuery().order[1]>
10		<cfset assert('loc.orderData.property eq "id"')>
11		<cfset assert('loc.orderData.direction eq "ASC"')>
12	</cffunction>
13
14	<cffunction name="test_set_order_multiple_times">
15		<cfset loc.authorModel.order("id").order("authorid", "desc")>
16		<cfset loc.order1Data = loc.authorModel.toQuery().order[1]>
17		<cfset loc.order2Data = loc.authorModel.toQuery().order[2]>
18		<cfset assert('loc.order1Data.property eq "id"')>
19		<cfset assert('loc.order1Data.direction eq "ASC"')>
20		<cfset assert('loc.order2Data.property eq "authorid"')>
21		<cfset assert('loc.order2Data.direction eq "DESC"')>
22	</cffunction>
23
24</cfcomponent>