Add user mirage factory

This commit is contained in:
Susmitha Girumala committed 2020-06-23 14:56:13 -04:00
1 parent d7967446d4
commit 3c37d38c97
4 files changed
+27

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
import { Factory } from 'ember-cli-mirage';
export default Factory.extend();
@@ -0,0 +1,16 @@
import { Factory } from 'ember-cli-mirage';
import { random, date } from 'faker';
/**
* GeneratedUserModelFactory
* User contains all fields related to a User resource
*/
export default Factory.extend({
name: () => random.words(),
description: () => random.words(),
created_time: () => date.recent(),
updated_time: () => date.recent(),
disabled: () => random.boolean(),
});
+3
View File
@@ -12,6 +12,9 @@ export default function(server) {
// same items for request at all scopes.
server.createList('auth-method', 3);
// User
server.createList('user', 5);
// Other resources
server.createList('host-catalog', 6);
+5
View File
@@ -0,0 +1,5 @@
import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({
modelName: 'user'
});