-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy pathrole.js
More file actions
29 lines (27 loc) · 727 Bytes
/
role.js
File metadata and controls
29 lines (27 loc) · 727 Bytes
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
'use strict';
import { setupPolly } from './polly';
describe('Role', function() {
setupPolly();
describe('constructor', function() {
it('normal usage', function() {
var acl = new AV.ACL();
var role = new AV.Role('foo', acl);
expect(role.getName()).to.be('foo');
expect(role.getACL()).to.be(acl);
});
it('acl is required', function() {
var role = new AV.Role('foo');
return role.save().should.be.rejected();
});
it('type check', function() {
expect(function() {
new AV.Role('foo', {});
}).to.throwError();
});
it('no argument', function() {
expect(function() {
new AV.Role();
}).not.to.throwError();
});
});
});