refactor: 💡 implement new pathing for auth methods

This commit is contained in:
Randall Morey committed 2020-09-09 12:24:01 -04:00
1 parent 83dc74460a
commit a368d65d10
17 files changed
+121 -41

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
import ApplicationAdapter from './application';
export default class AuthMethodAdapter extends ApplicationAdapter {
// =attributes
/**
* Auth methods use the new, unprefixed pathing style.
* @override
*/
hasScopePrefix = false;
}
@@ -0,0 +1,13 @@
import ApplicationSerializer from './application';
export default class AuthMethodSerializer extends ApplicationSerializer {
// =attributes
/**
* Serialized the scope ID into the `scope_id` field.
* @type {boolean}
*/
serializeScopeID = true;
}
+1
View File
@@ -0,0 +1 @@
export { default } from 'api/adapters/auth-method';
@@ -0,0 +1 @@
export { default } from 'api/serializers/auth-method';
@@ -0,0 +1,12 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Adapter | auth method', function(hooks) {
setupTest(hooks);
// Replace this with your real tests.
test('it exists', function(assert) {
let adapter = this.owner.lookup('adapter:auth-method');
assert.ok(adapter);
});
});
@@ -0,0 +1,24 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Serializer | auth method', function(hooks) {
setupTest(hooks);
// Replace this with your real tests.
test('it exists', function(assert) {
let store = this.owner.lookup('service:store');
let serializer = store.serializerFor('auth-method');
assert.ok(serializer);
});
test('it serializes records', function(assert) {
let store = this.owner.lookup('service:store');
let record = store.createRecord('auth-method', {});
let serializedRecord = record.serialize();
assert.ok(serializedRecord);
});
});