2018-09-25 16:28:26 +00:00
|
|
|
import { resolve } from 'rsvp';
|
|
|
|
import { module, test } from 'qunit';
|
|
|
|
import { setupTest } from 'ember-qunit';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
module('Unit | Adapter | capabilities', function (hooks) {
|
2018-09-25 16:28:26 +00:00
|
|
|
setupTest(hooks);
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('calls the correct url', function (assert) {
|
2018-09-25 16:28:26 +00:00
|
|
|
let url, method, options;
|
|
|
|
let adapter = this.owner.factoryFor('adapter:capabilities').create({
|
|
|
|
ajax: (...args) => {
|
|
|
|
[url, method, options] = args;
|
|
|
|
return resolve();
|
|
|
|
},
|
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
adapter.findRecord(null, 'capabilities', 'foo');
|
|
|
|
assert.equal('/v1/sys/capabilities-self', url, 'calls the correct URL');
|
|
|
|
assert.deepEqual({ paths: ['foo'] }, options.data, 'data params OK');
|
|
|
|
assert.equal('POST', method, 'method OK');
|
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|