vault/ui/tests/unit/adapters/identity/group-alias-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

31 lines
1011 B
JavaScript

import { moduleFor, test } from 'ember-qunit';
import testCases from './_test-cases';
import apiStub from 'vault/tests/helpers/noop-all-api-requests';
moduleFor('adapter:identity/group-alias', 'Unit | Adapter | identity/group-alias', {
needs: ['service:auth', 'service:flash-messages', 'service:control-group', 'service:version'],
beforeEach() {
this.server = apiStub();
},
afterEach() {
this.server.shutdown();
},
});
const cases = testCases('identity/group-alias');
cases.forEach(testCase => {
test(`group-alias#${testCase.adapterMethod}`, function(assert) {
assert.expect(2);
let adapter = this.subject();
adapter[testCase.adapterMethod](...testCase.args);
let { url, method } = this.server.handledRequests[0];
assert.equal(url, testCase.url, `${testCase.adapterMethod} calls the correct url: ${testCase.url}`);
assert.equal(
method,
testCase.method,
`${testCase.adapterMethod} uses the correct http verb: ${testCase.method}`
);
});
});