PageRenderTime 13ms CodeModel.GetById 9ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/wheels/tests/model/crud/findall.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 29 lines | 24 code | 5 blank | 0 comment | 0 complexity | 7715d88f1e8257b7c89aef367fbaa81d MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.source = model("user").findAll(select="id,lastName", maxRows=3)>
 5	</cffunction>
 6
 7	<cffunction name="test_in_operator_with_quoted_strings">
 8		<cfset loc.values = QuotedValueList(loc.source.lastName)>
 9		<cfset loc.q = model("user").findAll(where="lastName IN (#loc.values#)")>
10		<cfset assert('loc.q.recordCount IS 3')>
11	</cffunction>
12
13	<cffunction name="test_in_operator_with_numbers">
14		<cfset loc.values = ValueList(loc.source.id)>
15		<cfset loc.q = model("user").findAll(where="id IN (#loc.values#)")>
16		<cfset assert('loc.q.recordCount IS 3')>
17	</cffunction>
18
19	<cffunction name="test_custom_query_and_orm_query_in_transaction">
20		<cftransaction>
21			<cfquery name="loc.resultOne" datasource="#application.wheels.dataSourceName#">
22			SELECT id FROM users
23			</cfquery>
24			<cfset loc.resultTwo = model("user").findAll(select="id")>
25		</cftransaction>
26		<cfset assert("loc.resultOne.recordCount IS loc.resultTwo.recordCount")>
27	</cffunction>
28
29</cfcomponent>