public function testSetsHeaderWhenSessionHasRedirect()
{
$url = 'http://foo.bar/redirect';
$request = $this->createRequest('/', array('HTTP_X_XHR_REFERER' => 'http://foo.bar'));
$response = new Response();
$session = $this->getSessionMock();
$session->expects($this->once())->method('has')->with($this->equalTo('helthe_turbolinks_redirect_to'))->will($this->returnValue(true));
$session->expects($this->once())->method('remove')->with($this->equalTo('helthe_turbolinks_redirect_to'))->will($this->returnValue($url));
$request->setSession($session);
$this->turbolinks->decorateResponse($request, $response);
$this->assertTrue($response->headers->has('X-XHR-Redirected-To'));
$this->assertEquals($url, $response->headers->get('X-XHR-Redirected-To'));
$this->assertResponseHasNoCookies($response);
}