forked from nodeSolidServer/node-solid-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathacl-checker-test.js
More file actions
48 lines (43 loc) · 1.56 KB
/
acl-checker-test.js
File metadata and controls
48 lines (43 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
'use strict'
const ACLChecker = require('../../lib/acl-checker')
const chai = require('chai')
const { expect } = chai
chai.use(require('chai-as-promised'))
const options = { fetch: (url, callback) => {} }
describe('ACLChecker unit test', () => {
describe('getPossibleACLs', () => {
it('returns all possible ACLs of the root', () => {
const aclChecker = new ACLChecker('http://ex.org/', options)
expect(aclChecker.getPossibleACLs()).to.deep.equal([
'http://ex.org/.acl'
])
})
it('returns all possible ACLs of a regular file', () => {
const aclChecker = new ACLChecker('http://ex.org/abc/def/ghi', options)
expect(aclChecker.getPossibleACLs()).to.deep.equal([
'http://ex.org/abc/def/ghi.acl',
'http://ex.org/abc/def/.acl',
'http://ex.org/abc/.acl',
'http://ex.org/.acl'
])
})
it('returns all possible ACLs of an ACL file', () => {
const aclChecker = new ACLChecker('http://ex.org/abc/def/ghi.acl', options)
expect(aclChecker.getPossibleACLs()).to.deep.equal([
'http://ex.org/abc/def/ghi.acl',
'http://ex.org/abc/def/.acl',
'http://ex.org/abc/.acl',
'http://ex.org/.acl'
])
})
it('returns all possible ACLs of a directory', () => {
const aclChecker = new ACLChecker('http://ex.org/abc/def/ghi/', options)
expect(aclChecker.getPossibleACLs()).to.deep.equal([
'http://ex.org/abc/def/ghi/.acl',
'http://ex.org/abc/def/.acl',
'http://ex.org/abc/.acl',
'http://ex.org/.acl'
])
})
})
})