mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
d2baf80d58
refs #9866 - test/functional/ - test/functional/api - test/functional/api/v0.1 - test/functional/api/v0.1/utils - test/functional/api/v2 - test/functional/api/v2/admin - test/functional/api/v2/admin/utils - test/functional/api/v2/content - test/functional/api/v2/content/utils - updated grunt file - instead of `grunt test-routes`, you now need to use `grunt test-functional` (docs are updated) You can use `localUtils.API.getApiQuery('posts/')` and it will generate the correct API url.
19 lines
460 B
JavaScript
19 lines
460 B
JavaScript
const url = require('url');
|
|
const _ = require('lodash');
|
|
const testUtils = require('../../../utils');
|
|
const API_URL = '/ghost/api/v0.1/';
|
|
|
|
module.exports = {
|
|
API: {
|
|
getApiQuery(route) {
|
|
return url.resolve(API_URL, route);
|
|
}
|
|
},
|
|
|
|
doAuth() {
|
|
const args = Array.prototype.slice.call(arguments);
|
|
args.unshift(`${API_URL}authentication/token/`);
|
|
return testUtils.API.doAuth.apply(null, args);
|
|
}
|
|
};
|