I am using Grails 1.3.7. I am trying to check redirection in my integration test. Here is my controller and the method in question ...
class HomeController {
def design = {
....
if (params.page) {
redirect(uri: "/#/design/${params.page}")
}
else {
redirect(uri: "/#/design")
}
break;
}
}
However, in my integration test, the call to "controller.response.redirectedUrl" fails (always returns null), although I know that the redirect call is being made (checked by logging). What is wrong with the integration test below?
class HomeControllerTests extends grails.test.ControllerUnitTestCase {
....
void testHomePageDesign() {
def controller = new HomeController()
controller.design()
assert controller.response.redirectedUrl != null
assertTrue( responseStr != "" )
}
Thanks - Dave
source
share