title: Symfony2 FOS RestBundle Test
body: <p>I`m trying to write some functional tests for a REST API, created using FOS Rest Bundle. 
  The problem is that when I use the Symfony\Component\BrowserKit, symfony throws me the following error:
  <i>{"message":"Unable to find template \"AccountBundle:Account:list.html.twig\". .. }</i></p>
  
  <p>The code that I run is:</p>
  
  <pre><code>$client = static::createClient();
  $client-&gt;request('GET','/account');
  </code></pre>
  
  <p>When I run the request from the browser, it works fine.</p>
  
  <p>Here is the controller:</p>
  
  <pre><code>/**
   * Get channel by ID
   * @Secure(roles="ROLE_USER")
   * @RestView()
   * @ApiDoc(
   *  resource=true,
   *  description="Get channel by id",
   *  section="Channel",
   *  output="Channel"
   * )
   */
  public function getAction(Channel $channel)
  {
      return array('channel' =&gt; $channel);
  }
  </code></pre>
  
  <p>So when in test scenario, instead of returning the JSON tries to load the template.</p>