PageRenderTime 223ms CodeModel.GetById 70ms app.highlight 1ms RepoModel.GetById 100ms app.codeStats 0ms

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

http://cfwheels.googlecode.com/
ColdFusion CFScript | 18 lines | 15 code | 3 blank | 0 comment | 0 complexity | 471aa5684526df0bf1e309c4e6410518 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.authorModel = model("author")>
 5	</cffunction>
 6 
 7 	<cffunction name="test_setObject_valid">
 8		<cfset loc.author = loc.authorModel.findOne(where="firstName = 'James'")>
 9		<cfset loc.profile = model("profile").findOne()>
10		<cftransaction action="begin">
11			<cfset loc.updated = loc.author.setProfile(loc.profile) />
12			<cfset assert('loc.updated eq true')>
13			<cfset assert('loc.profile.authorid eq loc.author.id')>
14			<cftransaction action="rollback" />
15		</cftransaction>
16	</cffunction>
17
18</cfcomponent>