mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-11 12:12:55 +00:00
refactor: include latest changes from core#145
This commit is contained in:
@@ -56,7 +56,7 @@ describe('Create route', async function () {
|
||||
requestBodyName: 'fooBodyName',
|
||||
responseBodyName: 'barBodyName',
|
||||
statusCodeSuccess: statusCodeSuccess,
|
||||
urlFragment: '/foo',
|
||||
urlPath: '/foo',
|
||||
};
|
||||
handler = (_request, _app) => {
|
||||
return Promise.resolve(bodySuccess);
|
||||
@@ -84,7 +84,7 @@ describe('Create route', async function () {
|
||||
|
||||
const response = await supertest(app)
|
||||
// use method other than defined ("get" is not the method of the route)
|
||||
.get(routeClass.urlFragment)
|
||||
.get(routeClass.urlPath)
|
||||
.send();
|
||||
|
||||
expect(response.status).to.be.equal(methodNotAllowedError.statusCode);
|
||||
@@ -98,7 +98,7 @@ describe('Create route', async function () {
|
||||
app.use(router);
|
||||
|
||||
const response = await supertest(app)
|
||||
.post(routeClass.urlFragment)
|
||||
.post(routeClass.urlPath)
|
||||
.send();
|
||||
|
||||
expect(response.status).to.be.equal(statusCodeSuccess);
|
||||
@@ -116,7 +116,7 @@ describe('Create route', async function () {
|
||||
validatorStub.withArgs(body, routeClass.requestBodyName).returns({errors: [new Error('Foo Error')]});
|
||||
|
||||
const response = await startApp
|
||||
.post(routeClass.urlFragment)
|
||||
.post(routeClass.urlPath)
|
||||
.set('Content-Type', 'application/json')
|
||||
.set('Accept', 'application/json')
|
||||
.send(body);
|
||||
@@ -134,7 +134,7 @@ describe('Create route', async function () {
|
||||
validatorStub.withArgs(bodySuccess, routeClass.responseBodyName).returns({errors: [new Error('Foo Error')]});
|
||||
|
||||
const response = await startApp
|
||||
.post(routeClass.urlFragment)
|
||||
.post(routeClass.urlPath)
|
||||
.send();
|
||||
|
||||
expect(response.status).to.be.equal(internalServerError.statusCode);
|
||||
@@ -174,7 +174,7 @@ describe('Create route', async function () {
|
||||
sandbox.stub(validator, 'validate').returns({errors:[]});
|
||||
|
||||
const response = await startApp
|
||||
.post(routeClass.urlFragment)
|
||||
.post(routeClass.urlPath)
|
||||
.send();
|
||||
|
||||
expect(response.status).to.be.equal(internalServerError.statusCode);
|
||||
@@ -209,7 +209,7 @@ describe('Create route', async function () {
|
||||
sandbox.stub(validator, 'validate').returns({errors:[]});
|
||||
|
||||
const response = await startApp
|
||||
.post(routeClass.urlFragment)
|
||||
.post(routeClass.urlPath)
|
||||
.send();
|
||||
|
||||
expect(response.status).to.be.equal(fooErrorResponse.statusCode);
|
||||
|
||||
Reference in New Issue
Block a user