refactor: 💡 model grants as a fragment-array for statefulness
This commit is contained in:
8 files changed
+98
-10
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Model | fragment string', function(hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('fragment-string', {});
|
||||
assert.ok(model);
|
||||
});
|
||||
});
|
||||
@@ -17,7 +17,8 @@ module('Unit | Model | role', function (hooks) {
|
||||
this.server.post('/v1/scopes/o_1/roles/123abc:set-grants', (schema, request) => {
|
||||
const body = JSON.parse(request.requestBody);
|
||||
assert.deepEqual(body, {
|
||||
grants: ['grant1', 'grant2']
|
||||
grants: ['grant1', 'grant2'],
|
||||
version: 1
|
||||
});
|
||||
});
|
||||
const store = this.owner.lookup('service:store');
|
||||
@@ -28,7 +29,8 @@ module('Unit | Model | role', function (hooks) {
|
||||
attributes: {
|
||||
name: 'Role',
|
||||
description: 'Description',
|
||||
grants: ['grant1', 'grant2'],
|
||||
grants: [{value: 'grant1'}, {value: 'grant2'}],
|
||||
version: 1,
|
||||
scope: {
|
||||
scope_id: 'o_1',
|
||||
type: 'scope'
|
||||
|
||||
Reference in new issue
Block a user