-
-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get users should stop returning internal attributes if requested (#2158)
- Loading branch information
1 parent
37f76c4
commit c524f73
Showing
2 changed files
with
18 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { expect } = require('chai'); | ||
const { authenticatedRequest } = require('../controllers/request.test'); | ||
|
||
describe('/api/v1/user/', () => { | ||
it('should return all users without password', async () => { | ||
await authenticatedRequest | ||
.get('/api/v1/user?fields=password') | ||
.expect('Content-Type', /json/) | ||
.expect(200) | ||
.then((res) => { | ||
res.body.forEach((user) => { | ||
expect(user).to.not.have.property('password'); | ||
}); | ||
}); | ||
}); | ||
}); |