PageRenderTime 296ms CodeModel.GetById 111ms app.highlight 1ms RepoModel.GetById 123ms app.codeStats 14ms

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

http://cfwheels.googlecode.com/
ColdFusion CFScript | 18 lines | 15 code | 3 blank | 0 comment | 0 complexity | 08a769951fb6cb117f29db04d74a8366 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_deleteAllObjects_valid">
 8		<cfset loc.author = loc.authorModel.findOne(where="firstName = 'Per'")>
 9		<cftransaction action="begin">
10			<cfset loc.updated = loc.author.deleteAllPosts() />
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>