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:secret', 'Unit | Adapter | secret', {
|
2018-08-16 17:48:24 +00:00
|
|
|
needs,
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
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' });
|
2018-04-20 02:26:25 +00:00
|
|
|
assert.equal(url, '/v1/secret/', 'query generic url OK');
|
2018-04-03 14:16:57 +00:00
|
|
|
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' });
|
2018-04-20 02:26:25 +00:00
|
|
|
assert.equal(url, '/v1/secret/foo', 'queryRecord generic url OK');
|
2018-04-03 14:16:57 +00:00
|
|
|
assert.equal('GET', method, 'queryRecord generic method OK');
|
|
|
|
});
|