PageRenderTime 38ms CodeModel.GetById 36ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 1ms

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

http://cfwheels.googlecode.com/
ColdFusion CFScript | 18 lines | 15 code | 3 blank | 0 comment | 0 complexity | 5bc4898726b0680efd923cb02bcc6d78 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_addObject_valid">
 8		<cfset loc.author = loc.authorModel.findOne(where="firstName = 'James'")>
 9		<cfset loc.post = model("post").findOne()>
10		<cftransaction action="begin">
11			<cfset loc.updated = loc.author.addPost(loc.post) />
12			<cfset assert('loc.updated eq true')>
13			<cfset assert('loc.post.authorid eq loc.author.id')>
14			<cftransaction action="rollback" />
15		</cftransaction>
16	</cffunction>
17
18</cfcomponent>