mirror of
https://github.com/documize/community.git
synced 2025-07-27 09:09:44 +02:00
Refactor mirage config and tests to use new factories
This commit is contained in:
parent
663995b60d
commit
a215a05a88
5 changed files with 69 additions and 276 deletions
|
@ -13,48 +13,6 @@ export default function () {
|
||||||
return schema.db.meta[0];
|
return schema.db.meta[0];
|
||||||
});
|
});
|
||||||
|
|
||||||
this.get('/public/validate', function (schema, request) {
|
|
||||||
let serverToken = request.queryParams.token;
|
|
||||||
let token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkb21haW4iOiIiLCJleHAiOjE0NjQwMjM2NjcsImlzcyI6IkRvY3VtaXplIiwib3JnIjoiVnpNdXlFd18zV3FpYWZjRCIsInN1YiI6IndlYmFwcCIsInVzZXIiOiJWek11eUV3XzNXcWlhZmNFIn0.NXZ6bo8mtvdZF_b9HavbidVUJqhmBA1zr0fSAPvbah0";
|
|
||||||
|
|
||||||
if (token = serverToken) {
|
|
||||||
return {
|
|
||||||
"id": "VzMuyEw_3WqiafcE",
|
|
||||||
"created": "2016-05-11T15:08:24Z",
|
|
||||||
"revised": "2016-05-11T15:08:24Z",
|
|
||||||
"firstname": "Lennex",
|
|
||||||
"lastname": "Zinyando",
|
|
||||||
"email": "brizdigital@gmail.com",
|
|
||||||
"initials": "LZ",
|
|
||||||
"active": true,
|
|
||||||
"editor": true,
|
|
||||||
"admin": true,
|
|
||||||
"accounts": [{
|
|
||||||
"id": "VzMuyEw_3WqiafcF",
|
|
||||||
"created": "2016-05-11T15:08:24Z",
|
|
||||||
"revised": "2016-05-11T15:08:24Z",
|
|
||||||
"admin": true,
|
|
||||||
"editor": true,
|
|
||||||
"userId": "VzMuyEw_3WqiafcE",
|
|
||||||
"orgId": "VzMuyEw_3WqiafcD",
|
|
||||||
"company": "EmberSherpa",
|
|
||||||
"title": "EmberSherpa",
|
|
||||||
"message": "This Documize instance contains all our team documentation",
|
|
||||||
"domain": ""
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.get('/users/0/permissions', function () {
|
|
||||||
return [{
|
|
||||||
"folderId": "VzMygEw_3WrtFzto",
|
|
||||||
"userId": "",
|
|
||||||
"canView": true,
|
|
||||||
"canEdit": false
|
|
||||||
}];
|
|
||||||
});
|
|
||||||
|
|
||||||
this.get('/templates', function () {
|
this.get('/templates', function () {
|
||||||
return [];
|
return [];
|
||||||
});
|
});
|
||||||
|
@ -90,7 +48,9 @@ export default function () {
|
||||||
"tags": "",
|
"tags": "",
|
||||||
"template": false
|
"template": false
|
||||||
}];
|
}];
|
||||||
} else if (folder_id = "VzMygEw_3WrtFzto") {
|
}
|
||||||
|
|
||||||
|
if (folder_id = "VzMygEw_3WrtFzto") {
|
||||||
return {
|
return {
|
||||||
"id": "VzMygEw_3WrtFzto",
|
"id": "VzMygEw_3WrtFzto",
|
||||||
"created": "2016-05-11T13:24:17Z",
|
"created": "2016-05-11T13:24:17Z",
|
||||||
|
@ -100,7 +60,9 @@ export default function () {
|
||||||
"userId": "VzMuyEw_3WqiafcE",
|
"userId": "VzMuyEw_3WqiafcE",
|
||||||
"folderType": 1
|
"folderType": 1
|
||||||
};
|
};
|
||||||
} else if (folder_id = 'V0Vy5Uw_3QeDAMW9') {
|
}
|
||||||
|
|
||||||
|
if (folder_id = 'V0Vy5Uw_3QeDAMW9') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -110,8 +72,9 @@ export default function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.post('/folders', function (schema, request) {
|
this.post('/folders', function (schema, request) {
|
||||||
|
debugger;
|
||||||
var name = JSON.parse(request.requestBody).name;
|
var name = JSON.parse(request.requestBody).name;
|
||||||
let newFolder = {
|
let folder = {
|
||||||
"id": "V0Vy5Uw_3QeDAMW9",
|
"id": "V0Vy5Uw_3QeDAMW9",
|
||||||
"created": "2016-05-25T09:39:49Z",
|
"created": "2016-05-25T09:39:49Z",
|
||||||
"revised": "2016-05-25T09:39:49Z",
|
"revised": "2016-05-25T09:39:49Z",
|
||||||
|
@ -121,43 +84,19 @@ export default function () {
|
||||||
"folderType": 2
|
"folderType": 2
|
||||||
};
|
};
|
||||||
|
|
||||||
let folder = schema.db.folders.insert(newFolder);
|
return schema.db.folders.insert(folder);
|
||||||
return folder;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.post('/public/authenticate', (schema, request) => {
|
this.post('/public/authenticate', (schema, request) => {
|
||||||
let authorization = request.requestHeaders.Authorization;
|
let authorization = request.requestHeaders.Authorization;
|
||||||
let expectedAuthorization = "Basic OmJyaXpkaWdpdGFsQGdtYWlsLmNvbTp6aW55YW5kbzEyMw==";
|
let expectedAuthorization = "Basic OmJyaXpkaWdpdGFsQGdtYWlsLmNvbTp6aW55YW5kbzEyMw==";
|
||||||
|
let token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkb21haW4iOiIiLCJleHAiOjE0NjQwMjM2NjcsImlzcyI6IkRvY3VtaXplIiwib3JnIjoiVnpNdXlFd18zV3FpYWZjRCIsInN1YiI6IndlYmFwcCIsInVzZXIiOiJWek11eUV3XzNXcWlhZmNFIn0.NXZ6bo8mtvdZF_b9HavbidVUJqhmBA1zr0fSAPvbah0";
|
||||||
|
let user = schema.db.users.where({ id: "VzMuyEw_3WqiafcE" });
|
||||||
|
|
||||||
if (expectedAuthorization === authorization) {
|
if (expectedAuthorization === authorization) {
|
||||||
console.log("SSO login success");
|
|
||||||
return {
|
return {
|
||||||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkb21haW4iOiIiLCJleHAiOjE0NjQwMjM2NjcsImlzcyI6IkRvY3VtaXplIiwib3JnIjoiVnpNdXlFd18zV3FpYWZjRCIsInN1YiI6IndlYmFwcCIsInVzZXIiOiJWek11eUV3XzNXcWlhZmNFIn0.NXZ6bo8mtvdZF_b9HavbidVUJqhmBA1zr0fSAPvbah0",
|
"token": `${token}`,
|
||||||
"user": {
|
"user": user[0]
|
||||||
"id": "VzMuyEw_3WqiafcE",
|
|
||||||
"created": "2016-05-11T15:08:24Z",
|
|
||||||
"revised": "2016-05-11T15:08:24Z",
|
|
||||||
"firstname": "Lennex",
|
|
||||||
"lastname": "Zinyando",
|
|
||||||
"email": "brizdigital@gmail.com",
|
|
||||||
"initials": "LZ",
|
|
||||||
"active": true,
|
|
||||||
"editor": true,
|
|
||||||
"admin": true,
|
|
||||||
"accounts": [{
|
|
||||||
"id": "VzMuyEw_3WqiafcF",
|
|
||||||
"created": "2016-05-11T15:08:24Z",
|
|
||||||
"revised": "2016-05-11T15:08:24Z",
|
|
||||||
"admin": true,
|
|
||||||
"editor": true,
|
|
||||||
"userId": "VzMuyEw_3WqiafcE",
|
|
||||||
"orgId": "VzMuyEw_3WqiafcD",
|
|
||||||
"company": "EmberSherpa",
|
|
||||||
"title": "EmberSherpa",
|
|
||||||
"message": "This Documize instance contains all our team documentation",
|
|
||||||
"domain": ""
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,78 +105,27 @@ export default function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkb21haW4iOiIiLCJleHAiOjE0NjQwMjM2NjcsImlzcyI6IkRvY3VtaXplIiwib3JnIjoiVnpNdXlFd18zV3FpYWZjRCIsInN1YiI6IndlYmFwcCIsInVzZXIiOiJWek11eUV3XzNXcWlhZmNFIn0.NXZ6bo8mtvdZF_b9HavbidVUJqhmBA1zr0fSAPvbah0",
|
"token": `${token}`,
|
||||||
"user": {
|
"user": user[0]
|
||||||
"id": "VzMuyEw_3WqiafcE",
|
|
||||||
"created": "2016-05-11T15:08:24Z",
|
|
||||||
"revised": "2016-05-11T15:08:24Z",
|
|
||||||
"firstname": "Lennex",
|
|
||||||
"lastname": "Zinyando",
|
|
||||||
"email": "brizdigital@gmail.com",
|
|
||||||
"initials": "LZ",
|
|
||||||
"active": true,
|
|
||||||
"editor": true,
|
|
||||||
"admin": true,
|
|
||||||
"accounts": [{
|
|
||||||
"id": "VzMuyEw_3WqiafcF",
|
|
||||||
"created": "2016-05-11T15:08:24Z",
|
|
||||||
"revised": "2016-05-11T15:08:24Z",
|
|
||||||
"admin": true,
|
|
||||||
"editor": true,
|
|
||||||
"userId": "VzMuyEw_3WqiafcE",
|
|
||||||
"orgId": "VzMuyEw_3WqiafcD",
|
|
||||||
"company": "EmberSherpa",
|
|
||||||
"title": "EmberSherpa",
|
|
||||||
"message": "This Documize instance contains all our team documentation",
|
|
||||||
"domain": ""
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.get('/users/VzMuyEw_3WqiafcE/permissions', (schema) => {
|
this.get('/users/:id/permissions', (schema, request) => {
|
||||||
return schema.db.permissions;
|
let userId = request.params.id;
|
||||||
|
return schema.db.permissions.where({ userId: `${userId}` });
|
||||||
});
|
});
|
||||||
|
|
||||||
this.get('/folders/VzMuyEw_3WqiafcG/permissions', () => {
|
this.get('/folders/:id/permissions', (schema, request) => {
|
||||||
return [{
|
let id = request.params.id;
|
||||||
"folderId": "VzMuyEw_3WqiafcG",
|
return schema.db.folderPermissions.where({ id: `${id}` });
|
||||||
"userId": "VzMuyEw_3WqiafcE",
|
|
||||||
"canView": true,
|
|
||||||
"canEdit": true
|
|
||||||
}];
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.put('/folders/VzMygEw_3WrtFzto/permissions', () => {
|
this.put('/folders/:id/permissions', (schema, request) => {
|
||||||
return [{
|
let id = request.params.id;
|
||||||
"orgId": "VzMuyEw_3WqiafcD",
|
let attrs = JSON.parse(request.requestBody).Roles;
|
||||||
"folderId": "VzMygEw_3WrtFzto",
|
|
||||||
"userId": "",
|
|
||||||
"canEdit": true,
|
|
||||||
"canView": true
|
|
||||||
}, {
|
|
||||||
"orgId": "VzMuyEw_3WqiafcD",
|
|
||||||
"folderId": "VzMygEw_3WrtFzto",
|
|
||||||
"userId": "VzMyp0w_3WrtFztq",
|
|
||||||
"canEdit": false,
|
|
||||||
"canView": false
|
|
||||||
}, {
|
|
||||||
"orgId": "",
|
|
||||||
"folderId": "VzMygEw_3WrtFzto",
|
|
||||||
"userId": "VzMuyEw_3WqiafcE",
|
|
||||||
"canEdit": true,
|
|
||||||
"canView": true
|
|
||||||
}];
|
|
||||||
});
|
|
||||||
|
|
||||||
this.get('/folders/VzMygEw_3WrtFzto/permissions', () => {
|
// return schema.db.folderPermissions.update(`${id}`, { `${attrs[0]}` });
|
||||||
return [{
|
|
||||||
"folderId": "VzMygEw_3WrtFzto",
|
|
||||||
"userId": "VzMuyEw_3WqiafcE",
|
|
||||||
"canView": true,
|
|
||||||
"canEdit": true
|
|
||||||
}];
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.put('/folders/:id', (schema, request) => {
|
this.put('/folders/:id', (schema, request) => {
|
||||||
|
@ -264,18 +152,8 @@ export default function () {
|
||||||
return schema.db.folders.find(id);
|
return schema.db.folders.find(id);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.get('/organizations/VzMuyEw_3WqiafcD', () => {
|
this.get('/organizations/VzMuyEw_3WqiafcD', (schema) => {
|
||||||
return {
|
return schema.db.organizations[0];
|
||||||
"id": "VzMuyEw_3WqiafcD",
|
|
||||||
"created": "2016-05-11T15:08:24Z",
|
|
||||||
"revised": "2016-05-23T11:23:20Z",
|
|
||||||
"title": "EmberSherpa",
|
|
||||||
"message": "This Documize instance contains all our team documentation",
|
|
||||||
"url": "",
|
|
||||||
"domain": "",
|
|
||||||
"email": "brizdigital@gmail.com",
|
|
||||||
"allowAnonymousAccess": false
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.put('/organizations/VzMuyEw_3WqiafcD', (schema, request) => {
|
this.put('/organizations/VzMuyEw_3WqiafcD', (schema, request) => {
|
||||||
|
@ -283,69 +161,15 @@ export default function () {
|
||||||
let message = JSON.parse(request.requestBody).title;
|
let message = JSON.parse(request.requestBody).title;
|
||||||
let allowAnonymousAccess = JSON.parse(request.requestBody).allowAnonymousAccess;
|
let allowAnonymousAccess = JSON.parse(request.requestBody).allowAnonymousAccess;
|
||||||
|
|
||||||
return {
|
return schema.db.organizations.update('VzMuyEw_3WqiafcD', {
|
||||||
"id": "VzMuyEw_3WqiafcD",
|
title: `${title}`,
|
||||||
"created": "2016-05-11T15:08:24Z",
|
message: `${message}`,
|
||||||
"revised": "2016-05-23T11:23:20Z",
|
allowAnonymousAccess: `${allowAnonymousAccess}`
|
||||||
"title": `${title}`,
|
});
|
||||||
"message": `${message}`,
|
|
||||||
"url": "",
|
|
||||||
"domain": "",
|
|
||||||
"email": "brizdigital@gmail.com",
|
|
||||||
"allowAnonymousAccess": `${allowAnonymousAccess}`
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.get('/users', () => {
|
this.get('/users', (schema, request) => {
|
||||||
return [{
|
return schema.db.users;
|
||||||
"id": "VzMyp0w_3WrtFztq",
|
|
||||||
"created": "2016-05-11T13:24:55Z",
|
|
||||||
"revised": "2016-05-11T13:33:47Z",
|
|
||||||
"firstname": "Len",
|
|
||||||
"lastname": "Random",
|
|
||||||
"email": "zinyando@gmail.com",
|
|
||||||
"initials": "LR",
|
|
||||||
"active": true,
|
|
||||||
"editor": true,
|
|
||||||
"admin": false,
|
|
||||||
"accounts": [{
|
|
||||||
"id": "VzMyp0w_3WrtFztr",
|
|
||||||
"created": "2016-05-11T13:24:55Z",
|
|
||||||
"revised": "2016-05-11T13:24:55Z",
|
|
||||||
"admin": false,
|
|
||||||
"editor": true,
|
|
||||||
"userId": "VzMyp0w_3WrtFztq",
|
|
||||||
"orgId": "VzMuyEw_3WqiafcD",
|
|
||||||
"company": "EmberSherpa",
|
|
||||||
"title": "EmberSherpa",
|
|
||||||
"message": "This Documize instance contains all our team documentation",
|
|
||||||
"domain": ""
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
"id": "VzMuyEw_3WqiafcE",
|
|
||||||
"created": "2016-05-11T15:08:24Z",
|
|
||||||
"revised": "2016-05-11T15:08:24Z",
|
|
||||||
"firstname": "Lennex",
|
|
||||||
"lastname": "Zinyando",
|
|
||||||
"email": "brizdigital@gmail.com",
|
|
||||||
"initials": "LZ",
|
|
||||||
"active": true,
|
|
||||||
"editor": true,
|
|
||||||
"admin": true,
|
|
||||||
"accounts": [{
|
|
||||||
"id": "VzMuyEw_3WqiafcF",
|
|
||||||
"created": "2016-05-11T15:08:24Z",
|
|
||||||
"revised": "2016-05-11T15:08:24Z",
|
|
||||||
"admin": true,
|
|
||||||
"editor": true,
|
|
||||||
"userId": "VzMuyEw_3WqiafcE",
|
|
||||||
"orgId": "VzMuyEw_3WqiafcD",
|
|
||||||
"company": "EmberSherpa",
|
|
||||||
"title": "EmberSherpa",
|
|
||||||
"message": "This Documize instance contains all our team documentation",
|
|
||||||
"domain": ""
|
|
||||||
}]
|
|
||||||
}];
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.post('/users', (schema, request) => {
|
this.post('/users', (schema, request) => {
|
||||||
|
@ -353,7 +177,7 @@ export default function () {
|
||||||
let lastname = JSON.parse(request.requestBody).lastname;
|
let lastname = JSON.parse(request.requestBody).lastname;
|
||||||
let email = JSON.parse(request.requestBody).email;
|
let email = JSON.parse(request.requestBody).email;
|
||||||
|
|
||||||
return {
|
let user = {
|
||||||
"id": "V0RmtUw_3QeDAMW7",
|
"id": "V0RmtUw_3QeDAMW7",
|
||||||
"created": "2016-05-24T14:35:33Z",
|
"created": "2016-05-24T14:35:33Z",
|
||||||
"revised": "2016-05-24T14:35:33Z",
|
"revised": "2016-05-24T14:35:33Z",
|
||||||
|
@ -378,35 +202,14 @@ export default function () {
|
||||||
"domain": ""
|
"domain": ""
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return schema.db.users.insert(user);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.get('/users/VzMuyEw_3WqiafcE', () => {
|
this.get('/users/:id', (schema, request) => {
|
||||||
|
let id = request.params.id;
|
||||||
return {
|
let user = schema.db.users.where({ id: `${id}` });
|
||||||
"id": "VzMuyEw_3WqiafcE",
|
return user[0];
|
||||||
"created": "2016-05-11T15:08:24Z",
|
|
||||||
"revised": "2016-05-11T15:08:24Z",
|
|
||||||
"firstname": "Lennex",
|
|
||||||
"lastname": "Zinyando",
|
|
||||||
"email": "brizdigital@gmail.com",
|
|
||||||
"initials": "LZ",
|
|
||||||
"active": true,
|
|
||||||
"editor": true,
|
|
||||||
"admin": true,
|
|
||||||
"accounts": [{
|
|
||||||
"id": "VzMuyEw_3WqiafcF",
|
|
||||||
"created": "2016-05-11T15:08:24Z",
|
|
||||||
"revised": "2016-05-11T15:08:24Z",
|
|
||||||
"admin": true,
|
|
||||||
"editor": true,
|
|
||||||
"userId": "VzMuyEw_3WqiafcE",
|
|
||||||
"orgId": "VzMuyEw_3WqiafcD",
|
|
||||||
"company": "EmberSherpa",
|
|
||||||
"title": "EmberSherpa",
|
|
||||||
"message": "This Documize instance contains all our team documentation",
|
|
||||||
"domain": ""
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.put('/users/VzMuyEw_3WqiafcE', (schema, request) => {
|
this.put('/users/VzMuyEw_3WqiafcE', (schema, request) => {
|
||||||
|
@ -414,31 +217,11 @@ export default function () {
|
||||||
let lastname = JSON.parse(request.requestBody).lastname;
|
let lastname = JSON.parse(request.requestBody).lastname;
|
||||||
let email = JSON.parse(request.requestBody).email;
|
let email = JSON.parse(request.requestBody).email;
|
||||||
|
|
||||||
return {
|
return schema.db.users.update('VzMuyEw_3WqiafcE', {
|
||||||
"id": "VzMuyEw_3WqiafcE",
|
firstname: `${firstname}`,
|
||||||
"created": "2016-05-11T15:08:24Z",
|
lastname: `${lastname}`,
|
||||||
"revised": "2016-05-11T15:08:24Z",
|
email: `${email}`
|
||||||
"firstname": `${firstname}`,
|
});
|
||||||
"lastname": `${lastname}`,
|
|
||||||
"email": `${email}`,
|
|
||||||
"initials": "LZ",
|
|
||||||
"active": true,
|
|
||||||
"editor": true,
|
|
||||||
"admin": true,
|
|
||||||
"accounts": [{
|
|
||||||
"id": "VzMuyEw_3WqiafcF",
|
|
||||||
"created": "2016-05-11T15:08:24Z",
|
|
||||||
"revised": "2016-05-11T15:08:24Z",
|
|
||||||
"admin": true,
|
|
||||||
"editor": true,
|
|
||||||
"userId": "VzMuyEw_3WqiafcE",
|
|
||||||
"orgId": "VzMuyEw_3WqiafcD",
|
|
||||||
"company": "EmberSherpa",
|
|
||||||
"title": "EmberSherpa",
|
|
||||||
"message": "This Documize instance contains all our team documentation",
|
|
||||||
"domain": ""
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.post('/folders/VzMuyEw_3WqiafcG/invitation', () => {
|
this.post('/folders/VzMuyEw_3WqiafcG/invitation', () => {
|
||||||
|
|
|
@ -29,6 +29,7 @@ test('visiting / when not authenticated and with { allowAnonymousAccess: true }
|
||||||
test('visiting / when authenticated and with { allowAnonymousAccess: true } takes user to dashboard', function (assert) {
|
test('visiting / when authenticated and with { allowAnonymousAccess: true } takes user to dashboard', function (assert) {
|
||||||
server.create('meta', { allowAnonymousAccess: true });
|
server.create('meta', { allowAnonymousAccess: true });
|
||||||
server.createList('folder', 2);
|
server.createList('folder', 2);
|
||||||
|
server.createList('user', 2);
|
||||||
visit('/');
|
visit('/');
|
||||||
|
|
||||||
andThen(function () {
|
andThen(function () {
|
||||||
|
@ -38,6 +39,8 @@ test('visiting / when authenticated and with { allowAnonymousAccess: true } take
|
||||||
|
|
||||||
userLogin();
|
userLogin();
|
||||||
|
|
||||||
|
// return pauseTest();
|
||||||
|
|
||||||
andThen(function () {
|
andThen(function () {
|
||||||
assert.equal(find('.login').length, 0, 'Login button is not displayed');
|
assert.equal(find('.login').length, 0, 'Login button is not displayed');
|
||||||
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project', 'Dashboard is displayed after user is signed in');
|
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project', 'Dashboard is displayed after user is signed in');
|
||||||
|
|
|
@ -66,6 +66,7 @@ test('visiting space settings page', function (assert) {
|
||||||
server.create('meta', { allowAnonymousAccess: false });
|
server.create('meta', { allowAnonymousAccess: false });
|
||||||
server.createList('folder', 2);
|
server.createList('folder', 2);
|
||||||
server.createList('permission', 4);
|
server.createList('permission', 4);
|
||||||
|
server.createList('folder-permission', 2);
|
||||||
authenticateUser();
|
authenticateUser();
|
||||||
visit('/s/VzMuyEw_3WqiafcG/my-project');
|
visit('/s/VzMuyEw_3WqiafcG/my-project');
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ moduleForAcceptance('Acceptance | user profile');
|
||||||
|
|
||||||
test('visiting /profile', function (assert) {
|
test('visiting /profile', function (assert) {
|
||||||
server.createList('folder', 2);
|
server.createList('folder', 2);
|
||||||
|
server.createList('user', 2);
|
||||||
authenticateUser();
|
authenticateUser();
|
||||||
visit('/profile');
|
visit('/profile');
|
||||||
|
|
||||||
|
@ -29,6 +30,7 @@ test('visiting /profile', function (assert) {
|
||||||
|
|
||||||
test('changing user details and email ', function (assert) {
|
test('changing user details and email ', function (assert) {
|
||||||
server.createList('folder', 2);
|
server.createList('folder', 2);
|
||||||
|
server.createList('user', 2);
|
||||||
authenticateUser();
|
authenticateUser();
|
||||||
visit('/profile');
|
visit('/profile');
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ moduleForAcceptance('Acceptance | User Settings');
|
||||||
|
|
||||||
test('visiting /settings/general', function (assert) {
|
test('visiting /settings/general', function (assert) {
|
||||||
server.create('meta', { allowAnonymousAccess: false });
|
server.create('meta', { allowAnonymousAccess: false });
|
||||||
|
server.createList('organization', 1);
|
||||||
authenticateUser();
|
authenticateUser();
|
||||||
visit('/settings/general');
|
visit('/settings/general');
|
||||||
|
|
||||||
|
@ -29,6 +30,7 @@ test('visiting /settings/general', function (assert) {
|
||||||
|
|
||||||
test('changing the Website title and description', function (assert) {
|
test('changing the Website title and description', function (assert) {
|
||||||
server.create('meta', { allowAnonymousAccess: false });
|
server.create('meta', { allowAnonymousAccess: false });
|
||||||
|
server.createList('organization', 1);
|
||||||
authenticateUser();
|
authenticateUser();
|
||||||
visit('/settings/general');
|
visit('/settings/general');
|
||||||
|
|
||||||
|
@ -61,6 +63,7 @@ test('visiting /settings/folders', function (assert) {
|
||||||
|
|
||||||
test('visiting /settings/users', function (assert) {
|
test('visiting /settings/users', function (assert) {
|
||||||
server.create('meta', { allowAnonymousAccess: false });
|
server.create('meta', { allowAnonymousAccess: false });
|
||||||
|
server.createList('user', 2);
|
||||||
authenticateUser();
|
authenticateUser();
|
||||||
visit('/settings/users');
|
visit('/settings/users');
|
||||||
|
|
||||||
|
@ -75,6 +78,7 @@ test('visiting /settings/users', function (assert) {
|
||||||
|
|
||||||
test('add a new user', function (assert) {
|
test('add a new user', function (assert) {
|
||||||
server.create('meta', { allowAnonymousAccess: false });
|
server.create('meta', { allowAnonymousAccess: false });
|
||||||
|
server.createList('user', 2);
|
||||||
authenticateUser();
|
authenticateUser();
|
||||||
visit('/settings/users');
|
visit('/settings/users');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue