Test forward method of Controller

This blogpost titled “Test forward method of Controller” explains the technique that can be used to test forward method of controller. Recently, I was writing test cases in grails to test an action : def performAction() { forward(controller:...

Unroll data-driven testing in Spock

We often face a scenario where we have to run the same piece of test code over and over with different data. Spock’s data-driven testing is the answer for it. Let’s take a very common scenario of testing an action that creates the User record. This action...