From e30ff96d05580221a9aa25703f4b5cd61d7f6417 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 15 Jul 2020 17:00:51 -0400 Subject: [PATCH] test: store.findAll will request records from a specified scope ID --- addons/api/tests/unit/adapters/application-test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/api/tests/unit/adapters/application-test.js b/addons/api/tests/unit/adapters/application-test.js index bec9d581b..4e7342471 100644 --- a/addons/api/tests/unit/adapters/application-test.js +++ b/addons/api/tests/unit/adapters/application-test.js @@ -78,6 +78,16 @@ module('Unit | Adapter | application', function (hooks) { assert.equal(deleteRecordURL, '/v1/o_1/projects/4:my-custom-method'); }); + test('it can request records through the store from a specified scope', async function (assert) { + assert.expect(1); + const store = this.owner.lookup('service:store'); + this.server.get('/v1/p_456/groups', () => { + assert.ok(true, 'Scoped resource URL was requested.'); + return {items: []}; + }); + await store.findAll('group', {adapterOptions: {scope_id: 'p_456'}}); + }); + test('it rewrites PUT to PATCH, but leaves others unchanged', function (assert) { assert.expect(1); const adapter = this.owner.lookup('adapter:application');