Skip to content

Commit

Permalink
Add post model
Browse files Browse the repository at this point in the history
`ember g model post`

Outer red: Your Ember app tried to POST '/posts', but there was no route defined to handle this request. Define a route that matches this path in your mirage/config.js file.

Next we get an error from Mirage, our fake server. It needs a corresponding post creation endpoint created.
  • Loading branch information
Josh Justice authored and CodingItWrong committed Jan 12, 2019
1 parent af13695 commit 2f20a62
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/post.js
@@ -0,0 +1,5 @@
import DS from 'ember-data';

export default DS.Model.extend({

});
12 changes: 12 additions & 0 deletions tests/unit/models/post-test.js
@@ -0,0 +1,12 @@
import { moduleForModel, test } from 'ember-qunit';

moduleForModel('post', 'Unit | Model | post', {
// Specify the other units that are required for this test.
needs: []
});

test('it exists', function(assert) {
let model = this.subject();
// let store = this.store();
assert.ok(!!model);
});

0 comments on commit 2f20a62

Please sign in to comment.