$.proxy can be used to pass in extra args, no need for fn.bind

This commit is contained in:
JC Brand 2013-11-02 11:57:56 +02:00
parent ff345dcf51
commit b0f12d0f79
2 changed files with 4 additions and 6 deletions

View File

@ -7,7 +7,7 @@
} }
); );
} (this, function (mock, utils) { } (this, function (mock, utils) {
var chatrooms_spec_callback = function(mock, utils) { return describe("ChatRooms", $.proxy(function (mock, utils) {
describe("A Chat Room", $.proxy(function () { describe("A Chat Room", $.proxy(function () {
beforeEach($.proxy(function () { beforeEach($.proxy(function () {
if (!$("div#controlbox").is(':visible')) { if (!$("div#controlbox").is(':visible')) {
@ -262,6 +262,5 @@
expect(view.$el.find('.chat-body p').text()).toBe("This room has reached it's maximum number of occupants"); expect(view.$el.find('.chat-body p').text()).toBe("This room has reached it's maximum number of occupants");
}, converse)); }, converse));
}, converse)); }, converse));
}; }, converse, mock, utils));
return describe("ChatRooms", chatrooms_spec_callback.bind(converse, mock, utils));
})); }));

View File

@ -7,7 +7,7 @@
} }
); );
} (this, function (mock, utils) { } (this, function (mock, utils) {
var spec_callback = function(mock, utils) { return describe("Converse.js", $.proxy(function (mock, utils) {
describe("The Control Box", $.proxy(function () { describe("The Control Box", $.proxy(function () {
it("is not shown by default", $.proxy(function () { it("is not shown by default", $.proxy(function () {
expect(this.rosterview.$el.is(':visible')).toEqual(false); expect(this.rosterview.$el.is(':visible')).toEqual(false);
@ -705,6 +705,5 @@
}, converse)); }, converse));
}, converse)); }, converse));
}, converse)); }, converse));
}; }, converse, mock, utils));
return describe("Converse.js", spec_callback.bind(converse, mock, utils));
})); }));