Skip to content

Instantly share code, notes, and snippets.

@samselikoff
Created June 30, 2017 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samselikoff/46e2620dbea6a49549b61cc478975e6f to your computer and use it in GitHub Desktop.
Save samselikoff/46e2620dbea6a49549b61cc478975e6f to your computer and use it in GitHub Desktop.
import { Factory, faker, trait } from 'ember-cli-mirage';
export default Factory.extend({
title() {
return `Series ${faker.lorem.words()}`;
},
slug() {
return faker.helpers.slugify(faker.lorem.words());
},
subtitle() {
return faker.lorem.sentence();
},
description() {
return faker.lorem.sentence();
},
gradientPrimary: '#ff00cc',
gradientSecondary: '#333399',
posterUrl: 'https://dl.dropboxusercontent.com/u/8604053/ember-map/acceptance-testing.jpg',
withClips: trait({
afterCreate(series, server) {
server.create('clip', 'withEncodes', { series, title: 'Intro' });
server.create('clip', 'withEncodes', { series, viewingRequirement: 'subscription', title: 'Paid 1' });
server.create('clip', 'withEncodes', { series, viewingRequirement: 'subscription', title: 'Paid 2' });
server.create('clip', 'withEncodes', { series, viewingRequirement: 'account', title: 'Email wall 1' });
server.create('clip', 'withEncodes', { series, viewingRequirement: 'subscription', comingSoon: true, title: 'Coming soon' });
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment