PageRenderTime 18ms CodeModel.GetById 5ms app.highlight 0ms RepoModel.GetById 8ms app.codeStats 0ms

/wheels/tests/model/onmissingmethod/hasMany/hasobjects.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 26 lines | 21 code | 5 blank | 0 comment | 0 complexity | 5e8133003a9c62da423718d23cf9e5c9 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.authorModel = model("author")>
 5		<cfset loc.userModel = model("user")>
 6	</cffunction>
 7 
 8 	<cffunction name="test_hasObjects_valid">
 9		<cfset loc.author = loc.authorModel.findOne(where="firstName = 'Per'")>
10		<cfset loc.hasPosts = loc.author.hasPosts() />
11		<cfset assert('loc.hasPosts eq true')>
12	</cffunction>
13 
14 	<cffunction name="test_hasObjects_valid_with_combi_key">
15		<cfset loc.user = loc.userModel.findByKey(key=1)>
16		<cfset loc.hasCombiKeys = loc.user.hasCombiKeys() />
17		<cfset assert('loc.hasCombiKeys eq true')>
18	</cffunction>
19
20 	<cffunction name="test_hasObjects_returns_false">
21		<cfset loc.author = loc.authorModel.findOne(where="firstName = 'James'")>
22		<cfset loc.hasPosts = loc.author.hasPosts() />
23		<cfset assert('loc.hasPosts eq false')>
24	</cffunction>
25
26</cfcomponent>