Test Templates Plugin

testList() and testList_withParams() error in templated controller unit test in Grails 1.1

Details

  • Type: Sub-task Sub-task
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch Submitted:
    Yes

Description

The testList() and testList_withParams() error out using the generated controller in Grails 1.1:

No signature of method: static com.example.killerapp.Widget.count() is applicable for argument types: () values: []

A new call to count() was introduced in the list action in Grails 1.1. This is unexpected by the existing mock.

The attached patch does the following:
1) replace mockFor with mockDomain to implement the count() method.
2) verifies the instance list set on the model instead of the parameters passed to the list method
3) verifies the total set on the model

A workaround is to run install-test-templates, and fix ControllerUnitTests.groovy.

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: