/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. <cffunction name="setup">
  3. <cfset loc.authorModel = model("author")>
  4. </cffunction>
  5. <cffunction name="test_deleteAllObjects_valid">
  6. <cfset loc.author = loc.authorModel.findOne(where="firstName = 'Per'")>
  7. <cftransaction action="begin">
  8. <cfset loc.updated = loc.author.deleteAllPosts() />
  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>