mirror of
https://github.com/documize/community.git
synced 2025-07-20 21:59:42 +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 });
|
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') {
|
if (folder_id = 'V0Vy5Uw_3QeDAMW9') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.get('/documents/:id', function () {
|
this.get('/documents/:id', function (schema, request) {
|
||||||
return {
|
let id = request.params.id;
|
||||||
"id": "VzMzBUw_3WrtFztv",
|
return schema.db.documents.where({ id: `${id}` })[0];
|
||||||
"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/pages', function () {
|
this.get('/documents/:id/pages', function () {
|
||||||
|
|
|
@ -25,17 +25,3 @@ export default Factory.extend({
|
||||||
"tags": "",
|
"tags": "",
|
||||||
"template": false
|
"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) {
|
test('logging out a user', function (assert) {
|
||||||
server.create('meta', { allowAnonymousAccess: false });
|
server.create('meta', { allowAnonymousAccess: false });
|
||||||
userLogin();
|
userLogin();
|
||||||
|
click('.dropdown-menu a:contains(Logout)');
|
||||||
visit('/auth/logout');
|
|
||||||
|
|
||||||
andThen(function () {
|
andThen(function () {
|
||||||
assert.equal(currentURL(), '/auth/login', 'Logging out successful');
|
assert.equal(currentURL(), '/auth/login', 'Logging out successful');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue