mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
test for missing payload with POST
This commit is contained in:
parent
07e3a33b55
commit
a2ba98c360
2 changed files with 13 additions and 0 deletions
|
@ -96,6 +96,8 @@ export default function (server) {
|
|||
path: '/api/index-patterns',
|
||||
method: 'POST',
|
||||
handler: function (req, reply) {
|
||||
if (_.isEmpty(req.payload)) { reply(Boom.badRequest('Payload required')); }
|
||||
|
||||
const client = server.plugins.elasticsearch.client;
|
||||
const indexPattern = _.cloneDeep(req.payload);
|
||||
const isWildcard = _.contains(indexPattern.title, '*') || (indexPattern.title.match(/\[.*]/) !== null);
|
||||
|
|
|
@ -24,5 +24,16 @@ define(function (require) {
|
|||
});
|
||||
|
||||
});
|
||||
|
||||
bdd.describe('POST index-patterns', function postIndexPatterns() {
|
||||
|
||||
bdd.it('missing payload should return 400', function missingPayload() {
|
||||
return request.post('/index-patterns')
|
||||
.send({})
|
||||
.expect(400);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue