2018-04-03 14:16:57 +00:00
|
|
|
import { moduleFor, test } from 'ember-qunit';
|
|
|
|
import Ember from 'ember';
|
2018-08-16 17:48:24 +00:00
|
|
|
import needs from 'vault/tests/unit/adapters/_adapter-needs';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
|
|
|
moduleFor('adapter:capabilities', 'Unit | Adapter | capabilities', {
|
2018-08-16 17:48:24 +00:00
|
|
|
needs,
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test('calls the correct url', function(assert) {
|
|
|
|
let url, method, options;
|
|
|
|
let adapter = this.subject({
|
|
|
|
ajax: (...args) => {
|
|
|
|
[url, method, options] = args;
|
|
|
|
return Ember.RSVP.resolve();
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
adapter.findRecord(null, 'capabilities', 'foo');
|
|
|
|
assert.equal('/v1/sys/capabilities-self', url, 'calls the correct URL');
|
2018-04-20 01:51:41 +00:00
|
|
|
assert.deepEqual({ paths: ['foo'] }, options.data, 'data params OK');
|
2018-04-03 14:16:57 +00:00
|
|
|
assert.equal('POST', method, 'method OK');
|
|
|
|
});
|