mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 14:55:40 +08:00
adds small HasCurrentUser mixin test improvements
This commit is contained in:
parent
39e711783d
commit
e5269ab3e0
|
@ -1,14 +1,7 @@
|
||||||
module("Discourse.HasCurrentUser", {
|
module("Discourse.HasCurrentUser");
|
||||||
setup: function() {
|
|
||||||
sinon.stub(Discourse.User, "current");
|
|
||||||
},
|
|
||||||
|
|
||||||
teardown: function() {
|
|
||||||
Discourse.User.current.restore();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
test("adds `currentUser` property to an object and ensures it is not cached", function() {
|
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, {});
|
var testObj = Ember.Object.createWithMixins(Discourse.HasCurrentUser, {});
|
||||||
|
|
||||||
Discourse.User.current.returns("first user");
|
Discourse.User.current.returns("first user");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user