Details
Description
With mockDomain() in a unit test most dynamic finders are mocked. The comparator 'InList' (newly available since 1.1) is not mocked though and a use of it results in an error like 'No such property: authorInList for class: Book'.
As all other (=older) comparators get mocked and work pretty well, it is just confusing that 'InList' does not.
The following is the diff (based on grails 1.2.0):
MockUtils.groovy
-----------------------------------------------------
L60 "Between",
"InList" ])
R60 "Between" ])
-----------------------------------------------------
L983
case "InList":
if (propValue in args[0]) result << record
break;
MockUtilsTests.groovy
-----------------------------------------------------
L221
result = TestDomain.findByNameInList(["Alice Doe"])
assertEquals result, aliceDoeUS
result = TestDomain.findAllByNameInList(["Chris Jones"])
assertEquals 2, result.size()
assertEquals 2, TestDomain.countByNameInList(["John Smith"])
thanks.