testing - grails: how to test controller with multiple actions and multiple redirects? -
testing - grails: how to test controller with multiple actions and multiple redirects? -
i having next problem: want test logout action of controller. before calling login method of controller both redirect same page. getting next error message:
groovy.grails.web.servlet.mvc.exceptions.cannotredirectexception: cannot issue redirect(..) here. previous phone call redirect(..) has redirected response.
i understand problem, suggested solutions (calling reset() method; calling grailswebutil.bindmockwebrequest()) not work.
i doing integration testing , using class controllerunittestcase.
any suggestions? dominik
ok, found answer(s):
i forgot phone call setup super class:
@before void setup() { super.setup()
you cannot phone call reset() if want maintain session because clears session. phone call instead:
redirectargs.clear()
cheers, dominik
testing grails redirect controller action
Comments
Post a Comment