2023-03-15 16:00:52 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
import { setupTest } from 'ember-qunit';
|
2018-05-25 20:33:22 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
module('Unit | Adapter | console', function (hooks) {
|
2018-09-25 16:28:26 +00:00
|
|
|
setupTest(hooks);
|
2018-05-25 20:33:22 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('it builds the correct URL', function (assert) {
|
2022-11-09 23:15:31 +00:00
|
|
|
const adapter = this.owner.lookup('adapter:console');
|
|
|
|
const sysPath = 'sys/health';
|
|
|
|
const awsPath = 'aws/roles/my-other-role';
|
2022-10-18 15:46:02 +00:00
|
|
|
assert.strictEqual(adapter.buildURL(sysPath), '/v1/sys/health');
|
|
|
|
assert.strictEqual(adapter.buildURL(awsPath), '/v1/aws/roles/my-other-role');
|
2018-09-25 16:28:26 +00:00
|
|
|
});
|
2018-05-25 20:33:22 +00:00
|
|
|
});
|