fix: 🐛 pass scope_id in scope payload rather than query string

This commit is contained in:
Randall Morey committed 2020-09-08 11:58:01 -04:00
1 parent efbd779199
commit 48d4857821
6 files changed
+45 -40

No files matched your search

@@ -0,0 +1,31 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Serializer | scope', function(hooks) {
setupTest(hooks);
test('it serializes scope_id into payloads', function (assert) {
assert.expect(2);
const store = this.owner.lookup('service:store');
const serializer = store.serializerFor('scope');
serializer.serializeScopeID = true;
const record = store.createRecord('scope', {
name: 'My Scope',
description: 'Foo',
type: 'org',
scope: {
scope_id: 'global',
type: 'global'
}
});
const serializedRecord = record.serialize();
assert.equal(serializer.serializeScopeID, true);
assert.deepEqual(serializedRecord, {
name: 'My Scope',
description: 'Foo',
type: 'org',
scope_id: 'global'
});
});
});