Skip to content

Commit

Permalink
Add posts.show route
Browse files Browse the repository at this point in the history
`ember g route posts/show`

Outer red:
✘ Element .js-post-detail-title exists
✘ Element .js-post-detail-body exists

Now the acceptance test is able to display the `posts.show` route, but it can't find the post's title on the page, because we aren't rendering anything to the screen yet.
  • Loading branch information
Josh Justice authored and CodingItWrong committed Jan 12, 2019
1 parent 655a340 commit 48a34ba
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/router.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const Router = EmberRouter.extend({
Router.map(function() { Router.map(function() {
this.route('posts', function() { this.route('posts', function() {
this.route('new'); this.route('new');
this.route('show');
}); });
}); });


Expand Down
4 changes: 4 additions & 0 deletions app/routes/posts/show.js
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,4 @@
import Route from '@ember/routing/route';

export default Route.extend({
});
1 change: 1 addition & 0 deletions app/templates/posts/show.hbs
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
{{outlet}}
11 changes: 11 additions & 0 deletions tests/unit/routes/posts/show-test.js
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,11 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('route:posts/show', 'Unit | Route | posts/show', {
// 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 48a34ba

Please sign in to comment.