Use middleware instead of custom checks inside SchemasRouter.

This commit is contained in:
Nikita Lutsenko
2016-03-01 15:17:10 -08:00
parent 8ce0bd84fb
commit e58c935f22
2 changed files with 13 additions and 37 deletions

View File

@@ -98,8 +98,8 @@ describe('schemas', () => {
json: true,
headers: restKeyHeaders,
}, (error, response, body) => {
expect(response.statusCode).toEqual(401);
expect(body.error).toEqual('master key not specified');
expect(response.statusCode).toEqual(403);
expect(body.error).toEqual('unauthorized: master key is required');
done();
});
});
@@ -110,8 +110,8 @@ describe('schemas', () => {
json: true,
headers: restKeyHeaders,
}, (error, response, body) => {
expect(response.statusCode).toEqual(401);
expect(body.error).toEqual('master key not specified');
expect(response.statusCode).toEqual(403);
expect(body.error).toEqual('unauthorized: master key is required');
done();
});
});
@@ -206,8 +206,8 @@ describe('schemas', () => {
className: 'MyClass',
},
}, (error, response, body) => {
expect(response.statusCode).toEqual(401);
expect(body.error).toEqual('master key not specified');
expect(response.statusCode).toEqual(403);
expect(body.error).toEqual('unauthorized: master key is required');
done();
});
});