Skip to content

Commit

Permalink
Failing test for emberjs#3310
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemelia committed Sep 8, 2013
1 parent c1da580 commit c2df91c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/container/tests/container_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,3 +456,18 @@ test("The container can get options that should be applied to all factories for

ok(postView1 !== postView2, "The two lookups are different");
});

test("An injected non-singleton instance is never cached", function() {
var container = new Container();
var PostView = factory();
var PostViewHelper = factory();

container.register('view:post', PostView, { singleton: false });
container.register('view_helper:post', PostViewHelper, { singleton: false });
container.injection('view:post', 'viewHelper', 'view_helper:post');

var postView1 = container.lookup('view:post');
var postView2 = container.lookup('view:post');

ok(postView1.viewHelper !== postView2.viewHelper, "Injected non-singletons are not cached");
});

0 comments on commit c2df91c

Please sign in to comment.