test: 💍 add tests for adapter and serializer scope options

This commit is contained in:
Randall Morey committed 2020-09-03 14:48:59 -04:00
1 parent bce27df1f4
commit 2eeb73b622
6 files changed
+76 -8

No files matched your search

@@ -6,6 +6,16 @@ module('Unit | Adapter | scope', function(hooks) {
setupTest(hooks);
setupMirage(hooks);
test('it does not prefix URLs with `scopeID` for scope resources', function (assert) {
assert.expect(1);
const scopeID = 'global';
const adapter = this.owner.lookup('adapter:scope');
const prefix = adapter.urlPrefix(null, null, 'scope', null, {
adapterOptions: { scopeID }
});
assert.equal(prefix, `v1`);
});
test('it generates correct createRecord URLs with a scope_id query parameter', function (assert) {
assert.expect(1);
this.server.post('/v1/scopes', (schema, { queryParams }) =>{