diff --git a/mirage/factories/team.js b/mirage/factories/team.js new file mode 100644 index 00000000000..ffc8596e9e2 --- /dev/null +++ b/mirage/factories/team.js @@ -0,0 +1,17 @@ +import { Factory } from 'ember-cli-mirage'; + +const ORGS = ['rust-lang', 'emberjs', 'rust-random', 'georust', 'actix']; + +export default Factory.extend({ + name: i => `team-${i + 1}`, + + login(i) { + return `github:${ORGS[i % ORGS.length]}:${this.name}`; + }, + + url(i) { + return `https://github.com/${ORGS[i % ORGS.length]}`; + }, + + avatar: 'https://avatars1.githubusercontent.com/u/14631425?v=4', +}); diff --git a/mirage/factories/user.js b/mirage/factories/user.js new file mode 100644 index 00000000000..66ed4e55f74 --- /dev/null +++ b/mirage/factories/user.js @@ -0,0 +1,16 @@ +import { Factory } from 'ember-cli-mirage'; +import { dasherize } from '@ember/string'; + +export default Factory.extend({ + name: i => `User ${i + 1}`, + + login() { + return dasherize(this.name); + }, + + url() { + return `https://github.com/${this.login}`; + }, + + avatar: 'https://avatars1.githubusercontent.com/u/14631425?v=4', +});