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

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -