Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
test to get coverage back to 100
Browse files Browse the repository at this point in the history
  • Loading branch information
cianfoley-nearform committed Apr 6, 2018
1 parent 5f0689e commit ee6fa82
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/udaru-hapi-16-plugin/test/endToEnd/policies.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ lab.experiment('Policies - get/list', () => {
})
})

lab.test('search policy: error handling', (done) => {
const options = utils.requestOptions({
method: 'GET',
url: '/authorization/policies/search?query=acc'
})

const stub = sinon.stub(server.udaru.policies, 'search').yields(new Error('ERROR'))

server.inject(options, (response) => {
stub.restore()

expect(response.statusCode).to.equal(500)
done()
})
})

lab.test('search shared policies', (done) => {
const options = utils.requestOptions({
method: 'GET',
Expand All @@ -59,6 +75,22 @@ lab.experiment('Policies - get/list', () => {
})
})

lab.test('search policy: error handling', (done) => {
const options = utils.requestOptions({
method: 'GET',
url: '/authorization/shared-policies/search?query=pol'
})

const stub = sinon.stub(server.udaru.policies, 'search').yields(new Error('ERROR'))

server.inject(options, (response) => {
stub.restore()

expect(response.statusCode).to.equal(500)
done()
})
})

lab.test('get policy list: limit', (done) => {
const options = utils.requestOptions({
method: 'GET',
Expand Down

0 comments on commit ee6fa82

Please sign in to comment.