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

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

http://cfwheels.googlecode.com/
ColdFusion CFScript | 26 lines | 21 code | 5 blank | 0 comment | 0 complexity | 8456eb274d86d8ceeddd992d85770e2b 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_hasObject_valid">
 9		<cfset loc.author = loc.authorModel.findOne(where="firstName = 'Per'")>
10		<cfset loc.hasProfile = loc.author.hasProfile() />
11		<cfset assert('loc.hasProfile eq true')>
12	</cffunction>
13 
14 	<cffunction name="test_hasObject_valid_with_combi_key">
15		<cfset loc.user = loc.userModel.findByKey(key=1)>
16		<cfset loc.hasCombiKey = loc.user.hasCombiKey() />
17		<cfset assert('loc.hasCombiKey eq true')>
18	</cffunction>
19
20 	<cffunction name="test_hasObject_returns_false">
21		<cfset loc.author = loc.authorModel.findOne(where="firstName = 'James'")>
22		<cfset loc.hasProfile = loc.author.hasProfile() />
23		<cfset assert('loc.hasProfile eq false')>
24	</cffunction>
25
26</cfcomponent>