PageRenderTime 5ms CodeModel.GetById 2ms app.highlight 0ms RepoModel.GetById 2ms app.codeStats 0ms

/wheels/tests/model/onmissingmethod/belongsto/hasobject.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 26 lines | 21 code | 5 blank | 0 comment | 0 complexity | 09d36f1da4fb232e3379e1365e1b26f9 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.profileModel = model("profile")>
 5		<cfset loc.combiKeyModel = model("combiKey")>
 6	</cffunction>
 7
 8	<cffunction name="test_hasObject_valid">
 9		<cfset loc.profile = loc.profileModel.findByKey(key=1)>
10		<cfset loc.hasAuthor = loc.profile.hasAuthor() />
11		<cfset assert('loc.hasAuthor eq true')>
12	</cffunction>
13 
14 	<cffunction name="test_hasObject_valid_with_combi_key">
15		<cfset loc.combikey = loc.combiKeyModel.findByKey(key="1,1")>
16		<cfset loc.hasUser = loc.combikey.hasUser() />
17		<cfset assert('loc.hasUser eq true')>
18	</cffunction>
19
20	<cffunction name="test_hasObject_returns_false">
21		<cfset loc.profile = loc.profileModel.findByKey(key=2)>
22		<cfset loc.hasAuthor = loc.profile.hasAuthor() />
23		<cfset assert('loc.hasAuthor eq false')>
24	</cffunction>
25
26</cfcomponent>