-
-
Save samselikoff/5bcdcdee50faa0c0a679c3c4d35fe0ea to your computer and use it in GitHub Desktop.
santeau
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default function() { | |
| //window.server = this; | |
| this.get('staff-members'); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Factory, faker, trait } from 'ember-cli-mirage'; | |
| export default Factory.extend({ | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Factory, faker } from 'ember-cli-mirage'; | |
| export default Factory.extend({ | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Model, hasMany} from 'ember-cli-mirage'; | |
| export default Model.extend({ | |
| tasksCreated: hasMany('task', { | |
| inverse: 'creator' | |
| }), | |
| tasksAssigned: hasMany('task', { | |
| inverse: 'assignee' | |
| }) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Model, belongsTo, hasMany } from 'ember-cli-mirage'; | |
| export default Model.extend({ | |
| creator: belongsTo('staff-member'), | |
| assignee: belongsTo('staff-member') | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default function(server ) { | |
| let member1 = server.create('staff-member'); | |
| server.createList('task', 2, { creator: member1 }); | |
| server.create('task', { assignee: member1 }); | |
| let member2 = server.create('staff-member'); | |
| server.create('task', { creator: member2 }); | |
| server.createList('task', 3, { assignee: member2 }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { JSONAPISerializer } from 'ember-cli-mirage'; | |
| export default JSONAPISerializer.extend({ | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import DS from 'ember-data'; | |
| export default DS.Model.extend({ | |
| tasksCreated: DS.hasMany('task', { | |
| inverse: 'creator' | |
| }), | |
| tasksAssigned: DS.hasMany('task', { | |
| inverse: 'assignee' | |
| }) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import DS from 'ember-data'; | |
| export default DS.Model.extend({ | |
| creator: DS.belongsTo('staff-member', { | |
| inverse: null | |
| }), | |
| assignee: DS.belongsTo('staff-member', { | |
| inverse: null | |
| }) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| import config from './config/environment'; | |
| const Router = Ember.Router.extend({ | |
| location: 'none', | |
| rootURL: config.rootURL | |
| }); | |
| Router.map(function() { | |
| }); | |
| export default Router; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Route.extend({ | |
| model() { | |
| return this.store.findAll('staff-member'); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| margin: 0; | |
| font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
| font-size: 12pt; | |
| } | |
| h1 { | |
| font-size: 12px; | |
| font-weight: bold; | |
| text-align: center; | |
| text-shadow: none; | |
| background: #2e4068; | |
| color: white; | |
| padding: 20px; | |
| margin: 0; | |
| text-transform: uppercase; | |
| } | |
| p { | |
| font-weight: normal; | |
| } | |
| .pa4 { | |
| padding: 20px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { test } from 'qunit'; | |
| import moduleForAcceptance from '../../tests/helpers/module-for-acceptance'; | |
| moduleForAcceptance('Acceptance | Users'); | |
| test('I can see the users', function(assert) { | |
| server.create('user', { name: 'Link' }); | |
| //visit('/'); | |
| andThen(function() { | |
| assert.ok(true); | |
| //assert.ok(find(':contains(Welcome Link!)').length); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default function destroyApp(application) { | |
| Ember.run(application, 'destroy'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { module } from 'qunit'; | |
| import startApp from '../helpers/start-app'; | |
| import destroyApp from '../helpers/destroy-app'; | |
| export default function(name, options = {}) { | |
| module(name, { | |
| beforeEach() { | |
| this.application = startApp(); | |
| if (options.beforeEach) { | |
| options.beforeEach.apply(this, arguments); | |
| } | |
| }, | |
| afterEach() { | |
| if (options.afterEach) { | |
| options.afterEach.apply(this, arguments); | |
| } | |
| destroyApp(this.application); | |
| } | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Resolver from '../../resolver'; | |
| import config from '../../config/environment'; | |
| const resolver = Resolver.create(); | |
| resolver.namespace = { | |
| modulePrefix: config.modulePrefix, | |
| podModulePrefix: config.podModulePrefix | |
| }; | |
| export default resolver; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| import Application from '../../app'; | |
| import config from '../../config/environment'; | |
| export default function startApp(attrs) { | |
| let application; | |
| let attributes = Ember.merge({rootElement: "#test-root"}, config.APP); | |
| attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; | |
| Ember.run(() => { | |
| application = Application.create(attributes); | |
| application.setupForTesting(); | |
| application.injectTestHelpers(); | |
| }); | |
| return application; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import resolver from './helpers/resolver'; | |
| import { | |
| setResolver | |
| } from 'ember-qunit'; | |
| setResolver(resolver); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "0.10.4", | |
| "ENV": { | |
| "ember-cli-mirage": { | |
| "enabled": true | |
| } | |
| }, | |
| "EmberENV": { | |
| "FEATURES": { | |
| "ds-finder-include": true | |
| } | |
| }, | |
| "options": { | |
| "use_pods": false | |
| }, | |
| "dependencies": { | |
| "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
| "ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember.debug.js", | |
| "ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js", | |
| "ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember-template-compiler.js" | |
| }, | |
| "addons": { | |
| "ember-cli-mirage": "0.2.1" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment