PageRenderTime 31ms CodeModel.GetById 8ms RepoModel.GetById 0ms 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
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="setup">
  3. <cfset loc.authorModel = model("author")>
  4. </cffunction>
  5. <cffunction name="test_removeAllObjects_valid">
  6. <cfset loc.author = loc.authorModel.findOne(where="firstName = 'Per'")>
  7. <cftransaction action="begin">
  8. <cfset loc.updated = loc.author.removeAllPosts() />
  9. <cfset loc.posts = loc.author.posts() />
  10. <cfset assert('IsNumeric(loc.updated) and loc.updated eq 3')>
  11. <cfset assert('IsQuery(loc.posts) eq true and not loc.posts.Recordcount')>
  12. <cftransaction action="rollback" />
  13. </cftransaction>
  14. </cffunction>
  15. </cfcomponent>