fix: 🐛 fixes issue where grant strings become corrupted in ui

This commit is contained in:
Randall Morey committed 2020-10-30 13:23:19 -04:00
1 parent cf5e17af28
commit efa851928a
8 files changed
+41 -49

No files matched your search

+3 -3
View File
@@ -17,7 +17,7 @@ module('Unit | Model | role', function (hooks) {
this.server.post('/v1/roles/123abc:set-grants', (schema, request) => {
const body = JSON.parse(request.requestBody);
assert.deepEqual(body, {
grant_strings: ['grant1', 'grant2'],
grant_strings: ['foo', 'bar'],
version: 1,
});
return { id: '123abc' };
@@ -30,7 +30,7 @@ module('Unit | Model | role', function (hooks) {
attributes: {
name: 'Role',
description: 'Description',
grants: [{ value: 'grant1' }, { value: 'grant2' }],
grant_strings: ['grant1', 'grant2'],
version: 1,
scope: {
scope_id: 'o_1',
@@ -40,7 +40,7 @@ module('Unit | Model | role', function (hooks) {
},
});
const model = store.peekRecord('role', '123abc');
await model.saveGrants();
await model.saveGrants(['foo', 'bar']);
});
test('it has an `addPrincipals` method that targets a specific POST API endpoint and serialization', async function (assert) {