vault/ui/tests/unit/adapters/capabilities-test.js
Matthew Irish 8a8c932ea2
UI - control groups (#4947)
* add routes for control groups in tools, settings, access (#4718)
* UI control group - storage, request, authorization, and unwrapping (#4899)
* UI control groups config (#4927)
2018-07-18 20:59:04 -05:00

22 lines
712 B
JavaScript

import { moduleFor, test } from 'ember-qunit';
import Ember from 'ember';
moduleFor('adapter:capabilities', 'Unit | Adapter | capabilities', {
needs: ['service:auth', 'service:flash-messages', 'service:control-group', 'service:version'],
});
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');
assert.deepEqual({ paths: ['foo'] }, options.data, 'data params OK');
assert.equal('POST', method, 'method OK');
});