     it 'does not make async request for bucket region if error.region is set', ->
       regionReq = send: (fn) ->
         fn()
-      spy = helpers.spyOn(s3, 'listObjects').andReturn(regionReq)
+      spy = helpers.spyOn(s3, regionReqOperation).andReturn(regionReq)
       req = request('operation', {Bucket: 'name'})
       body = """
         <Error>

    it 'does not make request for bucket region if error code is not a region redirect code', ->
      regionReq = send: (fn) ->
        fn()
      spy = helpers.spyOn(s3, 'listObjects').andReturn(regionReq)
      req = request('operation', {Bucket: 'name'})
      body = """
        <Error>


  s3 = null
  request = (operation, params) -> s3.makeRequest(operation, params)
  regionReqOperation = if AWS.util.isNode() then 'headBucket' else 'listObjects'

  beforeEach (done) ->
    s3 = new AWS.S3(region: undefined)
