mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Fix auth test to use logout button and tweaks to mirage config
This commit is contained in:
parent
41735837b9
commit
fe1e457d96
3 changed files with 4 additions and 43 deletions
|
@ -35,38 +35,14 @@ export default function () {
|
|||
return schema.db.documents.where({ folderId: folder_id });
|
||||
}
|
||||
|
||||
if (folder_id = "VzMygEw_3WrtFzto") {
|
||||
return {
|
||||
"id": "VzMygEw_3WrtFzto",
|
||||
"created": "2016-05-11T13:24:17Z",
|
||||
"revised": "2016-05-11T13:25:51Z",
|
||||
"name": "Test",
|
||||
"orgId": "VzMuyEw_3WqiafcD",
|
||||
"userId": "VzMuyEw_3WqiafcE",
|
||||
"folderType": 1
|
||||
};
|
||||
}
|
||||
|
||||
if (folder_id = 'V0Vy5Uw_3QeDAMW9') {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
this.get('/documents/:id', function () {
|
||||
return {
|
||||
"id": "VzMzBUw_3WrtFztv",
|
||||
"created": "2016-05-11T13:26:29Z",
|
||||
"revised": "2016-05-11T13:26:29Z",
|
||||
"orgId": "VzMuyEw_3WqiafcD",
|
||||
"folderId": "VzMygEw_3WrtFzto",
|
||||
"userId": "VzMuyEw_3WqiafcE",
|
||||
"job": "3004c449-b053-49a6-4abc-72688136184d",
|
||||
"location": "/var/folders/d6/kr81d2fs5bsbm8rz2p092fy80000gn/T/documize/_uploads/3004c449-b053-49a6-4abc-72688136184d/README.md",
|
||||
"name": "README",
|
||||
"excerpt": "To Document/ Instructions. GO. go- bindata- assetsfs. SSL.",
|
||||
"tags": "",
|
||||
"template": false
|
||||
};
|
||||
this.get('/documents/:id', function (schema, request) {
|
||||
let id = request.params.id;
|
||||
return schema.db.documents.where({ id: `${id}` })[0];
|
||||
});
|
||||
|
||||
this.get('/documents/:id/pages', function () {
|
||||
|
|
|
@ -25,17 +25,3 @@ export default Factory.extend({
|
|||
"tags": "",
|
||||
"template": false
|
||||
});
|
||||
// return {
|
||||
// "id": "VzMzBUw_3WrtFztv",
|
||||
// "created": "2016-05-11T13:26:29Z",
|
||||
// "revised": "2016-05-11T13:26:29Z",
|
||||
// "orgId": "VzMuyEw_3WqiafcD",
|
||||
// "folderId": "VzMygEw_3WrtFzto",
|
||||
// "userId": "VzMuyEw_3WqiafcE",
|
||||
// "job": "3004c449-b053-49a6-4abc-72688136184d",
|
||||
// "location": "/var/folders/d6/kr81d2fs5bsbm8rz2p092fy80000gn/T/documize/_uploads/3004c449-b053-49a6-4abc-72688136184d/README.md",
|
||||
// "name": "README",
|
||||
// "excerpt": "To Document/ Instructions. GO. go- bindata- assetsfs. SSL.",
|
||||
// "tags": "",
|
||||
// "template": false
|
||||
// };
|
||||
|
|
|
@ -30,8 +30,7 @@ test('visiting /auth/login and logging in', function (assert) {
|
|||
test('logging out a user', function (assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
userLogin();
|
||||
|
||||
visit('/auth/logout');
|
||||
click('.dropdown-menu a:contains(Logout)');
|
||||
|
||||
andThen(function () {
|
||||
assert.equal(currentURL(), '/auth/login', 'Logging out successful');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue