Commit 304b2757 authored by JC Brand's avatar JC Brand

Fix tests. removeRoom method doesn't exist anymore

parent fc4bec1e
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
'listRooms': function () {}, 'listRooms': function () {},
'join': function () {}, 'join': function () {},
'leave': function () {}, 'leave': function () {},
'removeRoom': function () {},
'rooms': {} 'rooms': {}
}, },
'jid': 'dummy@localhost', 'jid': 'dummy@localhost',
......
...@@ -143,7 +143,6 @@ ...@@ -143,7 +143,6 @@
waits(250); waits(250);
runs(function () { runs(function () {
var $chat_body = view.$el.find('.chat-body'); var $chat_body = view.$el.find('.chat-body');
expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.renderPasswordForm).toHaveBeenCalled(); expect(view.renderPasswordForm).toHaveBeenCalled();
expect($chat_body.find('form.chatroom-form').length).toBe(1); expect($chat_body.find('form.chatroom-form').length).toBe(1);
expect($chat_body.find('legend').text()).toBe('This chatroom requires a password'); expect($chat_body.find('legend').text()).toBe('This chatroom requires a password');
...@@ -163,7 +162,6 @@ ...@@ -163,7 +162,6 @@
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'showErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe('You are not on the member list of this room'); expect(view.$el.find('.chat-body p').text()).toBe('You are not on the member list of this room');
}, converse)); }, converse));
...@@ -180,7 +178,6 @@ ...@@ -180,7 +178,6 @@
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'showErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe('You have been banned from this room'); expect(view.$el.find('.chat-body p').text()).toBe('You have been banned from this room');
}, converse)); }, converse));
...@@ -197,7 +194,6 @@ ...@@ -197,7 +194,6 @@
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'showErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe('No nickname was specified'); expect(view.$el.find('.chat-body p').text()).toBe('No nickname was specified');
}, converse)); }, converse));
...@@ -214,7 +210,6 @@ ...@@ -214,7 +210,6 @@
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'showErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe('You are not allowed to create new rooms'); expect(view.$el.find('.chat-body p').text()).toBe('You are not allowed to create new rooms');
}, converse)); }, converse));
...@@ -231,7 +226,6 @@ ...@@ -231,7 +226,6 @@
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'showErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe("Your nickname doesn't conform to this room's policies"); expect(view.$el.find('.chat-body p').text()).toBe("Your nickname doesn't conform to this room's policies");
}, converse)); }, converse));
...@@ -248,7 +242,6 @@ ...@@ -248,7 +242,6 @@
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'showErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe("Your nickname is already taken"); expect(view.$el.find('.chat-body p').text()).toBe("Your nickname is already taken");
}, converse)); }, converse));
...@@ -265,7 +258,6 @@ ...@@ -265,7 +258,6 @@
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'showErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe("This room does not (yet) exist"); expect(view.$el.find('.chat-body p').text()).toBe("This room does not (yet) exist");
}, converse)); }, converse));
...@@ -282,7 +274,6 @@ ...@@ -282,7 +274,6 @@
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'showErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment