 
   beforeEach ->
     @visitStub = stub(Turbolinks, "visit")
+    @replaceStateStub = stub(Turbolinks, "replaceState")
 
   afterEach ->
     @visitStub.restore()
+    @replaceStateStub.restore()
 
   it 'is defined', ->
     assert Page

      loadPageStub.restore()

    it 'updates window push state when response is a redirect', ->
      replaceStateStub = stub(Turbolinks, "replaceState")

      mockXHR = {
        getResponseHeader: (header) ->

        response: mockXHR,
        onlyKeys: ['a']

      @replaceStateStub.calledWith mockXHR.getResponseHeader('X-XHR-Redirected-To')
