Fixed invite management tests

no issue

- adjusts mirage config so that we're correctly serializing foreign keys
- our API outputs (and our app code expects) foreign keys for non-embedded resources to be in the format `{relationship_name}_id` but mirage's default REST serializer does not include the `_id` suffix
- tests started failing because cc0aa73355 introduced a direct access of the invite->role relationship which Ember Data was not correctly creating when mirage was outputting `role` rather than `role_id`
This commit is contained in:
Kevin Ansfield 2020-01-08 15:36:17 +00:00
parent bf7570d379
commit 3f7f3812e7
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,10 @@ export default RestSerializer.extend({
return underscore(relationship);
},
keyForForeignKey(relationshipName) {
return `${underscore(relationshipName)}_id`;
},
serialize(object, request) {
// Ember expects pluralized responses for the post, user, and invite models,
// and this shortcut will ensure that those models are pluralized