return 204 for successful POST an use JSON for all response payloads
This commit is contained in:
parent
e9810328a9
commit
e1bb5f58c4
|
@ -24,7 +24,7 @@ module.exports = function registerDelete(server) {
|
|||
})
|
||||
])
|
||||
.then(function (pattern) {
|
||||
reply('success');
|
||||
reply({success: true});
|
||||
}, function (error) {
|
||||
reply(handleESError(error));
|
||||
});
|
||||
|
|
|
@ -91,7 +91,7 @@ module.exports = function registerPost(server) {
|
|||
});
|
||||
})
|
||||
.then(() => {
|
||||
reply('success').code(201);
|
||||
reply().code(204);
|
||||
})
|
||||
.catch(function (error) {
|
||||
reply(handleESError(error));
|
||||
|
|
|
@ -14,7 +14,7 @@ define(function (require) {
|
|||
.then(function () {
|
||||
return request.post('/kibana/ingest')
|
||||
.send(createTestData())
|
||||
.expect(201);
|
||||
.expect(204);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -38,16 +38,16 @@ define(function (require) {
|
|||
]);
|
||||
});
|
||||
|
||||
bdd.it('should return 201 when an ingest config is successfully created', function createIngestConfig() {
|
||||
bdd.it('should return 204 when an ingest config is successfully created', function createIngestConfig() {
|
||||
return request.post('/kibana/ingest')
|
||||
.send(createTestData())
|
||||
.expect(201);
|
||||
.expect(204);
|
||||
});
|
||||
|
||||
bdd.it('should create an index template if a fields array is included', function createTemplate() {
|
||||
return request.post('/kibana/ingest')
|
||||
.send(createTestData())
|
||||
.expect(201)
|
||||
.expect(204)
|
||||
.then(function () {
|
||||
return scenarioManager.client.indices.getTemplate({name: 'kibana-logstash-*'});
|
||||
});
|
||||
|
@ -56,7 +56,7 @@ define(function (require) {
|
|||
bdd.it('should provide defaults for field properties', function createTemplate() {
|
||||
return request.post('/kibana/ingest')
|
||||
.send(createTestData())
|
||||
.expect(201)
|
||||
.expect(204)
|
||||
.then(function () {
|
||||
return scenarioManager.client.get({
|
||||
index: '.kibana',
|
||||
|
@ -82,7 +82,7 @@ define(function (require) {
|
|||
function createTemplate() {
|
||||
return request.post('/kibana/ingest')
|
||||
.send(createTestData())
|
||||
.expect(201)
|
||||
.expect(204)
|
||||
.then(function () {
|
||||
return scenarioManager.client.indices.getTemplate({name: 'kibana-logstash-*'})
|
||||
.then(function (template) {
|
||||
|
@ -112,7 +112,7 @@ define(function (require) {
|
|||
bdd.it('should return 409 conflict when a pattern with the given ID already exists', function patternConflict() {
|
||||
return request.post('/kibana/ingest')
|
||||
.send(createTestData())
|
||||
.expect(201)
|
||||
.expect(204)
|
||||
.then(function () {
|
||||
return request.post('/kibana/ingest')
|
||||
.send(createTestData())
|
||||
|
|
Loading…
Reference in a new issue