adds small HasCurrentUser mixin test improvements

This commit is contained in:
Wojciech Zawistowski 2013-12-19 18:54:24 +01:00
parent 39e711783d
commit e5269ab3e0

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");