Ghost/ghost/admin/mirage/factories/invite.js
Kevin Ansfield 1db799e634 🐛 display correct expired/expires text for invites (#550)
closes https://github.com/TryGhost/Ghost/issues/8055

- use `expired` if the date is in the past, otherwise `expires`
- fix mirage factories to use `moment.valueOf` instead of `moment.unix` for invite `expires` attributes
2017-02-27 13:11:39 +00:00

14 lines
464 B
JavaScript

import {Factory} from 'ember-cli-mirage';
export default Factory.extend({
token(i) { return `${i}-token`; },
email(i) { return `invited-user-${i}@example.com`; },
expires() { return moment.utc().add(1, 'day').valueOf(); },
createdAt() { return moment.utc().format(); },
createdBy() { return 1; },
updatedAt() { return moment.utc().format(); },
updatedBy() { return 1; },
status() { return 'sent'; },
roleId() { return 1; }
});