Merge pull request #1749 from velesin/has_current_user_test_improvement

adds small HasCurrentUser mixin test improvements
This commit is contained in:
Régis Hanol 2013-12-23 05:47:46 -08:00
commit 34cbea64d1
1 changed files with 2 additions and 9 deletions

View File

@ -1,14 +1,7 @@
module("Discourse.HasCurrentUser", {
setup: function() {
sinon.stub(Discourse.User, "current");
},
teardown: function() {
Discourse.User.current.restore();
}
});
module("Discourse.HasCurrentUser");
test("adds `currentUser` property to an object and ensures it is not cached", function() {
sinon.stub(Discourse.User, "current");
var testObj = Ember.Object.createWithMixins(Discourse.HasCurrentUser, {});
Discourse.User.current.returns("first user");