PageRenderTime 18ms CodeModel.GetById 15ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://cfwheels.googlecode.com/
ColdFusion CFScript | 18 lines | 15 code | 3 blank | 0 comment | 0 complexity | 1dcb178ebd25e94a05d6405d26460d2a 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_removeAllObjects_valid">
 8		<cfset loc.author = loc.authorModel.findOne(where="firstName = 'Per'")>
 9		<cftransaction action="begin">
10			<cfset loc.updated = loc.author.removeAllPosts() />
11			<cfset loc.posts = loc.author.posts() />
12			<cfset assert('IsNumeric(loc.updated) and loc.updated eq 3')>
13			<cfset assert('IsQuery(loc.posts) eq true and not loc.posts.Recordcount')>
14			<cftransaction action="rollback" />
15		</cftransaction>
16	</cffunction>
17
18</cfcomponent>