PageRenderTime 303ms CodeModel.GetById 141ms app.highlight 0ms RepoModel.GetById 140ms app.codeStats 21ms

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

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