-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GET patient/:id to also allow first responders
- Loading branch information
Showing
2 changed files
with
7 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,22 +19,14 @@ describe('/api/v1/patients', () => { | |
}); | ||
|
||
describe('GET /:id', () => { | ||
it('should return a 403 error if not an ADMIN, STAFF or VOLUNTEER user', async (t) => { | ||
it('should return UNAUTHORIZED if the user is not logged in', async (t) => { | ||
const app = await build(t); | ||
await t.loadFixtures(); | ||
|
||
let reply = await app | ||
.inject() | ||
.get('/api/v1/patients/27963f68-ebc1-408a-8bb5-8fbe54671064'); | ||
assert.deepStrictEqual(reply.statusCode, StatusCodes.UNAUTHORIZED); | ||
|
||
let headers = await t.authenticate('[email protected]', 'test'); | ||
reply = await app | ||
.inject() | ||
.get('/api/v1/patients/27963f68-ebc1-408a-8bb5-8fbe54671064') | ||
.headers(headers); | ||
|
||
assert.deepStrictEqual(reply.statusCode, StatusCodes.FORBIDDEN); | ||
}); | ||
|
||
it('should allow ADMIN to retrieve a patient', async (t) => { | ||
|