Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions blueprints/route/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ module.exports = {
return blueprint.fileMapTokens.apply(blueprint, arguments);
},

locals: function() {
var blueprint = ancestralBlueprint('route', this.project);
return blueprint.locals.apply(blueprint, arguments);
},

shouldTouchRouter: function(name, options) {
return ancestralBlueprint('route', this.project).shouldTouchRouter(name, options);
},
Expand Down
18 changes: 8 additions & 10 deletions node-tests/blueprints/resource-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ var file = chai.file;
describe('Acceptance: ember generate and destroy resource', function() {
setupTestHooks(this);

it.skip('resource foo', function() {
var args = ['resource', 'foo'];
it('resource foo', function() {
var args = ['resource', 'foo', '--skip-router'];

return emberNew()
.then(() => emberGenerateDestroy(args, (_file) => {
expect(_file('app/routes/foo.coffee'))
.to.contain("import Ember from 'ember'")
.to.contain('FooRoute = Ember.Route.extend()')
.to.contain("export default FooRoute");
.to.contain('export default Ember.Route.extend()');

expect(_file('app/templates/foo.hbs'))
.to.contain('{{outlet}}');
Expand All @@ -31,16 +30,15 @@ describe('Acceptance: ember generate and destroy resource', function() {

expect(_file('app/models/foo.coffee'))
.to.contain("import DS from 'ember-data'")
.to.contain('Foo = DS.Model.extend {')
.to.contain("export default Foo");
.to.contain('export default DS.Model.extend {');

expect(_file('tests/unit/models/foo-test.coffee'))
.to.contain("moduleForModel 'foo'");

expect(file('app/router.coffee'))
.to.contain("@route 'foo'");
// expect(file('app/router.coffee'))
// .to.contain("@route 'foo'");
}))
.then(() => expect(file('app/router.coffee'))
.to.not.contain("@route 'foo'"));
// .then(() => expect(file('app/router.coffee'))
// .to.not.contain("@route 'foo'"));
Copy link
Contributor

@olleolleolle olleolleolle Apr 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these comments remain? (in both files)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they should be kept as a reminder that the router part should also be tested, I just don't know how to do it in a simple way. Similar to the old test that was skipped.

});
});
17 changes: 8 additions & 9 deletions node-tests/blueprints/route-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ var expectCoffee = require('../helpers/expect-coffee');
describe('Acceptance: ember generate and destroy route', function() {
setupTestHooks(this);

it.skip('route foo', function() {
var args = ['route', 'foo'];
it('route foo', function() {
var args = ['route', 'foo', '--skip-router'];

return emberNew()
.then(() => emberGenerateDestroy(args, (_file) => {
expect(_file('app/routes/foo.coffee'))
.to.contain("import Ember from 'ember'")
.to.contain('FooRoute = Ember.Route.extend()')
.to.contain("export default FooRoute");
.to.contain('export default Ember.Route.extend()');

expect(_file('app/templates/foo.hbs'))
.to.contain('{{outlet}}');
Expand All @@ -30,12 +29,12 @@ describe('Acceptance: ember generate and destroy route', function() {
.to.contain("import { moduleFor, test } from 'ember-qunit'")
.to.contain("moduleFor 'route:foo', 'Unit | Route | foo', {");

expect(file('app/router.coffee'))
.to.contain("@route 'foo'");
// expect(file('app/router.coffee'))
// .to.contain("@route 'foo'");
})
.then(() => expect(file('app/router.coffee'))
.to.not.contain("@route 'foo'")
));
// .then(() => expect(file('app/router.coffee'))
// .to.not.contain("@route 'foo'"))
);
});

it('route-test foo', function() {
Expand Down