From a5b80ea6906706dc9418e7fccbbe65e9286f19a4 Mon Sep 17 00:00:00 2001 From: Eoin Nolan Date: Mon, 10 Jun 2019 13:56:01 -0300 Subject: [PATCH] Example of confusing error message --- tests/unit/mocks/mock-any-test.js | 4 ++++ tests/unit/mocks/mock-find-all-test.js | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/tests/unit/mocks/mock-any-test.js b/tests/unit/mocks/mock-any-test.js index cc4140b1..5ac58cea 100644 --- a/tests/unit/mocks/mock-any-test.js +++ b/tests/unit/mocks/mock-any-test.js @@ -180,6 +180,10 @@ module('MockAny', function(hooks) { assert.equal(fooMock.timesCalled, 1, 'fooMock#timesCalled is called once'); assert.equal(barMock.timesCalled, 1, 'barMock#timesCalled is called once'); + + mock({url: '/api/post/some-stuff', type: method}).withParams({ rightParams: true }); + await fetchJSON({url, params: { wrongParams: true }, method}); + }); test("#withSomeParams", async function(assert) { diff --git a/tests/unit/mocks/mock-find-all-test.js b/tests/unit/mocks/mock-find-all-test.js index 89530d71..95e5b9cc 100644 --- a/tests/unit/mocks/mock-find-all-test.js +++ b/tests/unit/mocks/mock-find-all-test.js @@ -132,6 +132,12 @@ module('MockFindAll', function(hooks) { assert.equal(mockQ.timesCalled, 1, 'mockQuery is used'); }); + test("#withParams", async function(assert) { + let mockFQ = mockFindAll('user', 2).withParams({rightParams: true}); + + await FactoryGuy.store.query('user', { rightParams: false }); + }); + module('#getUrl', function() { test("uses urlForFindAll if it is set on the adapter", function(assert) {