title: Grails: testing a redirect with an integration test
body: <p>I'm using Grails 1.3.7.  I'm trying to test a redirect in my integration test.  Here is my controller and method in question ...</p>
  
  <pre><code>class HomeController {
  
  def design = {
      ....
              if (params.page) {
                  redirect(uri: "/#/design/${params.page}")
              }
              else {
                  redirect(uri: "/#/design")
              }
              break;
      }
  }
  </code></pre>
  
  <p>However in my integration test, the call to "controller.response.redirectedUrl" is failing (always returns null) even though I know the redirect call is being made (verified through logging).  What is wrong with the integration test below?</p>
  
  <pre><code>class HomeControllerTests extends grails.test.ControllerUnitTestCase {
      ....
  
      void testHomePageDesign() { 
         def controller = new HomeController()
  
         // Call action without any parameters
         controller.design()
  
         assert controller.response.redirectedUrl != null
  
         assertTrue( responseStr != "" )
      }   
  </code></pre>
  
  <p>Thanks, - Dave</p>