PageRenderTime 81ms CodeModel.GetById 40ms app.highlight 1ms RepoModel.GetById 39ms app.codeStats 1ms

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

http://cfwheels.googlecode.com/
ColdFusion CFScript | 17 lines | 14 code | 3 blank | 0 comment | 0 complexity | 38aa94c860d4b65f26fc578619242b89 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_createObject_valid">
 8		<cfset loc.author = loc.authorModel.findOne(where="firstName = 'James'")>
 9		<cftransaction action="begin">
10			<cfset loc.post = loc.author.createPost(title="Title for first test post", body="Text for first test post", views=0) />
11			<cfset assert('IsObject(loc.post) eq true')>
12			<cfset assert('loc.post.authorid eq loc.author.id')>
13			<cftransaction action="rollback" />
14		</cftransaction>
15	</cffunction>
16
17</cfcomponent>