mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 14:11:16 +08:00
ES6: Convert all test files over
This commit is contained in:
12
test/javascripts/mixins/has-current-user-test.js.es6
Normal file
12
test/javascripts/mixins/has-current-user-test.js.es6
Normal file
@ -0,0 +1,12 @@
|
||||
module("Discourse.HasCurrentUser");
|
||||
|
||||
test("adds `currentUser` property to an object and ensures it is not cached", function() {
|
||||
sandbox.stub(Discourse.User, "current");
|
||||
var testObj = Ember.Object.createWithMixins(Discourse.HasCurrentUser, {});
|
||||
|
||||
Discourse.User.current.returns("first user");
|
||||
equal(testObj.get("currentUser"), "first user", "on the first call property returns initial user");
|
||||
|
||||
Discourse.User.current.returns("second user");
|
||||
equal(testObj.get("currentUser"), "second user", "if the user changes, on the second call property returns changed user");
|
||||
});
|
Reference in New Issue
Block a user