mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
Merge pull request #1749 from velesin/has_current_user_test_improvement
adds small HasCurrentUser mixin test improvements
This commit is contained in:
@ -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");
|
||||
|
Reference in New Issue
Block a user