Ghost/core/test/functional/api/v0.1/utils.js
Katharina Irrgang d2baf80d58
Optimised test folder structure (#9958)
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.
2018-10-07 16:36:02 +02:00

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);
}
};