dhumphreys/cfrel — Issue #39: Write CFWheels tests in plugin
Author: dhumphreys
Created: 2011-12-22 14:08:33+00:00
State: open
Labels: cfwheels

Should test at least the following:

* Simple query: ```model("a").select(...).query()```
* Complex query: ```model("a").select(...).where(...).order(...).query()```
* Manual join: ```model("a").join("b", "a.x = b.y", ..., ...).query()```
* Simple include: ```model("a").include("b,c(d(e)").query()```
* Double include: ```model("a").include("b(c),c(b)").query()```
* Reverse include: ```model("a).include("b(a)").query()```
* Aggregate query: ```model("a").selectGroup(...).select(...).having(...).query()```
* Sub-query: ```model("a").where(...).subquery().selectGroup(...).select(...).order(...).query()```
* Query-of-query: ```model("a").where(...).qoq().where(...).order(...).query()```
* Calculated properties: ```model("a").select("*", ...).query()```
* Object creation: ```model("a").rel().objects(flat=?, deep=?)```
* Structure creation: ```model("a").rel().structs(flat=?, deep=?)```

Tests should be written in the CFWheels testing framework (see http://code.google.com/p/cfwheels/wiki/TestingFramework) and contain tests using both the cfrel methods and the wheels methods. To avoid a repeating issue, each query should be ran twice, with the second version returning zero rows. We need to confirm that empty recordsets do not mess up in various situations. Tests that are specific to certain known/past bugs should be documented as such, and maybe placed in a special area of the test methods.