Permalink
Browse files

Add new blog post route

`ember g route posts/new`

We only change enough code to get to the next error message. Getting past the "no route" error only requires creating the route in the routes file.

Red: Element not found when calling `fillIn('.js-post-form-title')`

The next error is simple: no title form field is found to fill text into.
  • Loading branch information...
CodingItWrong committed Jan 10, 2018
1 parent 919d865 commit 7a30c21b64cec6bba3ba73bc32c9068ae778c09e
Showing with 19 additions and 0 deletions.
  1. +3 −0 app/router.js
  2. +4 −0 app/routes/posts/new.js
  3. +1 −0 app/templates/posts/new.hbs
  4. +11 −0 tests/unit/routes/posts/new-test.js
@@ -7,6 +7,9 @@ const Router = EmberRouter.extend({
});
Router.map(function() {
this.route('posts', function() {
this.route('new');
});
});
export default Router;
@@ -0,0 +1,4 @@
import Route from '@ember/routing/route';
export default Route.extend({
});
@@ -0,0 +1 @@
{{outlet}}
@@ -0,0 +1,11 @@
import { moduleFor, test } from 'ember-qunit';
moduleFor('route:posts/new', 'Unit | Route | posts/new', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
test('it exists', function(assert) {
let route = this.subject();
assert.ok(route);
});

0 comments on commit 7a30c21

Please sign in to comment.