Skip to content

Commit

Permalink
Force building of requests in failing Glacier/Route53 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lsegal committed Mar 2, 2013
1 parent bb66f62 commit 19137e0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
15 changes: 8 additions & 7 deletions test/services/glacier.spec.coffee
Expand Up @@ -20,16 +20,17 @@ describe 'AWS.Glacier.Client', ->
client = new AWS.Glacier.Client()

describe 'building requests', ->
beforeEach ->
helpers.mockHttpResponse 200, {}, 'response'

it 'sets accountId to "-" if not set', ->
resp = client.listVaults().send()
expect(resp.request.httpRequest.path).toEqual('/-/vaults')
req = client.listVaults()
req.emit('validate', req)
req.emit('build', req)
expect(req.httpRequest.path).toEqual('/-/vaults')

it 'will not override accountId if set', ->
resp = client.listVaults(accountId: 'ABC123').send()
expect(resp.request.httpRequest.path).toEqual('/ABC123/vaults')
req = client.listVaults(accountId: 'ABC123')
req.emit('validate', req)
req.emit('build', req)
expect(req.httpRequest.path).toEqual('/ABC123/vaults')

describe 'computeChecksums', ->
it 'returns correct linear and tree hash for buffer data', ->
Expand Down
10 changes: 6 additions & 4 deletions test/services/route53.spec.coffee
Expand Up @@ -31,9 +31,11 @@ describe 'AWS.Route53.Client', ->
client = new AWS.Route53.Client

it 'should fix hosted zone ID on input', ->
resp = client.getHostedZone(Id: '/hostedzone/ABCDEFG').send()
expect(resp.request.httpRequest.path).toMatch('/hostedzone/ABCDEFG$')
req = client.getHostedZone(Id: '/hostedzone/ABCDEFG')
req.emit('build', req)
expect(req.httpRequest.path).toMatch('/hostedzone/ABCDEFG$')

it 'should fix health check ID on input', ->
resp = client.getHealthCheck(HealthCheckId: '/healthcheck/ABCDEFG').send()
expect(resp.request.httpRequest.path).toMatch('/healthcheck/ABCDEFG$')
req = client.getHealthCheck(HealthCheckId: '/healthcheck/ABCDEFG')
req.emit('build', req)
expect(req.httpRequest.path).toMatch('/healthcheck/ABCDEFG$')

0 comments on commit 19137e0

Please sign in to comment.