【发布时间】:2012-01-14 13:50:14
【问题描述】:
我遇到以下问题: 我想测试我的控制器的注销操作。在此之前,我正在调用我的控制器的登录方法,它们都重定向到同一页面。现在我收到以下错误消息:
groovy.grails.web.servlet.mvc.exceptions.CannotRedirectException: Cannot issue a redirect(..) here. A previous call to redirect(..) has already redirected the response.
我确实理解这个问题,但是所有建议的解决方案(调用 reset() 方法;调用 GrailsWebUtil.bindMockWebRequest())都不起作用。
我正在进行集成测试并使用 ControllerUnitTestCase 类。
有什么建议吗? 谢谢 多米尼克
【问题讨论】:
标签: testing grails redirect controller action