vault/ui/tests/unit/adapters/secret-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

26 lines
917 B
JavaScript

import { moduleFor, test } from 'ember-qunit';
import Ember from 'ember';
moduleFor('adapter:secret', 'Unit | Adapter | secret', {
needs: ['service:auth', 'service:flash-messages', 'service:control-group', 'service:version'],
});
test('secret api urls', function(assert) {
let url, method, options;
let adapter = this.subject({
ajax: (...args) => {
[url, method, options] = args;
return Ember.RSVP.resolve({});
},
});
adapter.query({}, 'secret', { id: '', backend: 'secret' });
assert.equal(url, '/v1/secret/', 'query generic url OK');
assert.equal('GET', method, 'query generic method OK');
assert.deepEqual(options, { data: { list: true } }, 'query generic url OK');
adapter.queryRecord({}, 'secret', { id: 'foo', backend: 'secret' });
assert.equal(url, '/v1/secret/foo', 'queryRecord generic url OK');
assert.equal('GET', method, 'queryRecord generic method OK');
});