PageRenderTime 333ms CodeModel.GetById 201ms app.highlight 1ms RepoModel.GetById 130ms app.codeStats 0ms

/wheels/tests/model/crud/where.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 31 lines | 26 code | 5 blank | 0 comment | 0 complexity | 51fd52c5bb2950af76a74e5119f40773 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<!--- <cffunction name="test_contains_multiple_spaces_tabs_and_carriage_returns">
 4		<cfset loc.r = model("post").findAll(where="views
 5
 6					 >=
 7					   5   		   AND
 8		  averagerating
 9		   >
10		   				3")>
11		<cfset assert('loc.r.recordcount eq 1')>
12	</cffunction> --->
13	
14	<cffunction name="test_should_not_strip_extra_whitespace_from_values">
15		<cfset loc.r = model("user").findAll(where="address = '123     Petruzzi St.'")>
16		<cfset assert('loc.r.recordcount eq 0')>
17		<cfset loc.r = model("user").findAll(where="address = '123 Petruzzi St.'")>
18		<cfset assert('loc.r.recordcount eq 2')>
19	</cffunction>
20
21	<cffunction name="test_in_statement_should_not_error">
22		<cfset loc.r = model("user").findAll(where="username IN('tonyp','perd','chrisp') AND (firstname = 'Tony' OR firstname = 'Per' OR firstname = 'Chris') OR id IN(1,2,3)")>
23		<cfset assert('loc.r.recordcount eq 3')>
24	</cffunction>
25	
26	<cffunction name="test_in_statement_respect_parenthesis_commas_and_single_quotes">
27		<cfset loc.r = model("user").findAll(where="username IN('tony''s','pe''(yo,yo)rd','chrisp')")>
28		<cfset assert('loc.r.recordcount eq 1')>
29	</cffunction>
30
31</cfcomponent>