Skip to content
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 fa1cdf7 commit ce1c0f709aea9d62a52fd2292a7d755a82082489
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 ce1c0f7

Please sign in to comment.
You can’t perform that action at this time.