Skip to content

Commit

Permalink
Add new blog post route
Browse files Browse the repository at this point in the history
`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
Josh Justice authored and CodingItWrong committed Feb 28, 2019
1 parent fa1cdf7 commit ce1c0f7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/router.js
Expand Up @@ -7,6 +7,9 @@ const Router = EmberRouter.extend({
});

Router.map(function() {
this.route('posts', function() {
this.route('new');
});
});

export default Router;
4 changes: 4 additions & 0 deletions app/routes/posts/new.js
@@ -0,0 +1,4 @@
import Route from '@ember/routing/route';

export default Route.extend({
});
1 change: 1 addition & 0 deletions app/templates/posts/new.hbs
@@ -0,0 +1 @@
{{outlet}}
11 changes: 11 additions & 0 deletions tests/unit/routes/posts/new-test.js
@@ -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.