Skip to content

Commit

Permalink
Merge pull request #61 from ef4/view-deprecation
Browse files Browse the repository at this point in the history
Don't replace Ember's internal view:toplevel
  • Loading branch information
rwjblue committed Jun 18, 2015
2 parents 480deb6 + 9f5cfd5 commit eedfaf4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ember-test-helpers/build-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export default function(resolver) {
function register(name, factory) {
var thingToRegisterWith = registry || container;

thingToRegisterWith.register(name, factory);
if (!container.lookupFactory(name)) {
thingToRegisterWith.register(name, factory);
}
}

if (Ember.Application.buildRegistry) {
Expand Down
22 changes: 22 additions & 0 deletions tests/test-module-for-integration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,25 @@ test('it has working events', function() {
this.$('.target').click();
equal(this.$('.value').text(), '1');
});

var origDeprecate;
moduleForComponent('Component Integration Tests: implicit views are not deprecated', {
integration: true,
setup: function () {
origDeprecate = Ember.deprecate;
Ember.deprecate = function(msg, check) {
if (!check) {
throw new Error("unexpected deprecation: " + msg);
}
};
},
teardown: function () {
Ember.deprecate = origDeprecate;
}
});

test('the toplevel view is not deprecated', function () {
expect(0);
(this.registry || this.container).register('component:my-toplevel', this.container.lookupFactory('view:toplevel'));
this.render("{{my-toplevel}}");
});

0 comments on commit eedfaf4

Please sign in to comment.