mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
adds small HasCurrentUser mixin test improvements
This commit is contained in:
parent
39e711783d
commit
e5269ab3e0
1 changed files with 2 additions and 9 deletions
|
@ -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 a new issue