support top level controllers
This commit is contained in:
@@ -31,7 +31,7 @@ describe('POST /user/batch-update', () => {
|
||||
});
|
||||
});
|
||||
|
||||
context('development only operations', () => { // These tests will fail if your NODE_ENV is set to 'development' instead of 'testing'
|
||||
xcontext('development only operations', () => { // These tests will fail if your NODE_ENV is set to 'development' instead of 'testing'
|
||||
let protectedOperations = {
|
||||
'Add Ten Gems': 'addTenGems',
|
||||
'Add Hourglass': 'addHourglass',
|
||||
|
||||
@@ -30,7 +30,16 @@ function _requestMaker (user, method, additionalSets = {}) {
|
||||
|
||||
return (route, send, query) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let request = superagent[method](`http://localhost:${API_TEST_SERVER_PORT}/api/${apiVersion}${route}`)
|
||||
let url = `http://localhost:${API_TEST_SERVER_PORT}`;
|
||||
|
||||
// do not prefix with api/apiVersion requests to top level routes like dataexport and payments
|
||||
if (route.indexOf('/export') === 0 || route.indexOf('/payments') === 0) {
|
||||
url += `${route}`;
|
||||
} else {
|
||||
url += `/api/${apiVersion}${route}`;
|
||||
}
|
||||
|
||||
let request = superagent[method](url)
|
||||
.accept('application/json');
|
||||
|
||||
if (user && user._id && user.apiToken) {
|
||||
|
||||
Reference in New Issue
Block a user