fixes HeaderController test
This commit is contained in:
parent
39e711783d
commit
89bdebac3c
|
@ -1,12 +1,4 @@
|
||||||
module("Discourse.HeaderController", {
|
module("Discourse.HeaderController");
|
||||||
setup: function() {
|
|
||||||
sinon.stub(Discourse, "ajax");
|
|
||||||
},
|
|
||||||
|
|
||||||
teardown: function() {
|
|
||||||
Discourse.ajax.restore();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
test("showNotifications action", function() {
|
test("showNotifications action", function() {
|
||||||
var resolveRequestWith;
|
var resolveRequestWith;
|
||||||
|
@ -19,10 +11,10 @@ test("showNotifications action", function() {
|
||||||
var viewSpy = {
|
var viewSpy = {
|
||||||
showDropdownBySelector: sinon.spy()
|
showDropdownBySelector: sinon.spy()
|
||||||
};
|
};
|
||||||
Discourse.User.current().set("unread_notifications", 1);
|
this.stub(Discourse, "ajax").withArgs("/notifications").returns(request);
|
||||||
Ember.run(function() {
|
this.stub(Discourse.User, "current").returns(Discourse.User.create({
|
||||||
Discourse.ajax.withArgs("/notifications").returns(request);
|
unread_notifications: 1
|
||||||
});
|
}));
|
||||||
|
|
||||||
|
|
||||||
Ember.run(function() {
|
Ember.run(function() {
|
||||||
|
|
Loading…
Reference in New Issue