mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 05:03:37 +08:00
adds small HasCurrentUser mixin test improvements
This commit is contained in:
parent
39e711783d
commit
e5269ab3e0
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue
Block a user