refactor: 💡 model grants as a fragment-array for statefulness

This commit is contained in:
Randall Morey committed 2020-08-07 18:19:58 -04:00
1 parent 3b09ec80cd
commit e142e99fdb
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);
});
});
+4 -2
View File
@@ -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'