mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Added test coverage for members search
no issue - This test confirms there is no 404 returned when search fails to find any results. It's important to return a 200 in this case as some API clients (e.g. Zapier integration) could treat non-2xx responses as errors
This commit is contained in:
parent
8ecd6a7c71
commit
34875b85f3
1 changed files with 16 additions and 0 deletions
|
@ -90,6 +90,22 @@ describe('Members API', function () {
|
|||
});
|
||||
});
|
||||
|
||||
it('Search for non existing member returns empty result set', function () {
|
||||
return request
|
||||
.get(localUtils.API.getApiQuery('members/?search=do_not_exist'))
|
||||
.set('Origin', config.get('url'))
|
||||
.expect('Content-Type', /json/)
|
||||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect(200)
|
||||
.then((res) => {
|
||||
should.not.exist(res.headers['x-cache-invalidate']);
|
||||
const jsonResponse = res.body;
|
||||
should.exist(jsonResponse);
|
||||
should.exist(jsonResponse.members);
|
||||
jsonResponse.members.should.have.length(0);
|
||||
});
|
||||
});
|
||||
|
||||
it('Add should fail when passing incorrect email_type query parameter', function () {
|
||||
const member = {
|
||||
name: 'test',
|
||||
|
|
Loading…
Reference in a new issue