2018-10-05 15:04:42 +03:00
|
|
|
const url = require('url');
|
2018-10-05 15:33:46 +03:00
|
|
|
const _ = require('lodash');
|
|
|
|
const testUtils = require('../../../utils');
|
|
|
|
const API_URL = '/ghost/api/v0.1/';
|
2018-10-05 15:04:42 +03:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
API: {
|
|
|
|
getApiQuery(route) {
|
2018-10-05 15:33:46 +03:00
|
|
|
return url.resolve(API_URL, route);
|
2018-10-05 15:04:42 +03:00
|
|
|
}
|
2018-10-05 15:33:46 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
doAuth() {
|
|
|
|
const args = Array.prototype.slice.call(arguments);
|
|
|
|
args.unshift(`${API_URL}authentication/token/`);
|
2018-10-05 16:08:30 +03:00
|
|
|
return testUtils.API.doAuth.apply(null, args);
|
2018-10-05 15:04:42 +03:00
|
|
|
}
|
|
|
|
};
|