chore: 🤖 bump ember-can (#3093)
* chore: 🤖 bump ember-can * chore: 🤖 rename "can" service (deprecated) to abilities See https://github.com/minutebase/ember-can/pull/152 * chore: 🤖 bump to ember-can@^8 * chore: 🤖 extend resolver for ember-can v7 breaking change https://github.com/minutebase/ember-can/pull/186
This commit is contained in:
1 parent
29fb5b00cb
commit
b5d33948dc
107 files changed
+542
-435
No files matched your search
@@ -9,10 +9,10 @@ import { setupTest } from 'ember-qunit';
|
||||
module('Unit | Abilities | Scope', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
let canService;
|
||||
let abilitiesService;
|
||||
|
||||
hooks.beforeEach(function () {
|
||||
canService = this.owner.lookup('service:can');
|
||||
abilitiesService = this.owner.lookup('service:abilities');
|
||||
});
|
||||
test('it exists', function (assert) {
|
||||
const ability = this.owner.lookup('ability:scope');
|
||||
@@ -23,9 +23,9 @@ module('Unit | Abilities | Scope', function (hooks) {
|
||||
const model = {
|
||||
authorized_actions: ['attach-storage-policy'],
|
||||
};
|
||||
assert.true(canService.can('attachStoragePolicy scope', model));
|
||||
assert.true(abilitiesService.can('attachStoragePolicy scope', model));
|
||||
model.authorized_actions = [];
|
||||
assert.false(canService.can('attachStoragePolicy scope', model));
|
||||
assert.false(abilitiesService.can('attachStoragePolicy scope', model));
|
||||
});
|
||||
|
||||
test('it reflects when a given scope may remove a policy in org scope', function (assert) {
|
||||
@@ -33,8 +33,8 @@ module('Unit | Abilities | Scope', function (hooks) {
|
||||
authorized_actions: ['detach-storage-policy'],
|
||||
};
|
||||
|
||||
assert.true(canService.can('detachStoragePolicy scope', model));
|
||||
assert.true(abilitiesService.can('detachStoragePolicy scope', model));
|
||||
model.authorized_actions = [];
|
||||
assert.false(canService.can('detachStoragePolicy scope', model));
|
||||
assert.false(abilitiesService.can('detachStoragePolicy scope', model));
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user