         jasmine.Clock.tick(50000)
         socket.respondWithData "PING :#{(new Date()).getTime()}\r\n"
         jasmine.Clock.tick(50000)
-        irc.doCommand 'JOIN', '#sugarman'
+        irc.doCommand 'JOIN', '#awesome'
         waitsForArrayBufferConversion() # wait for JOIN
         runs ->
           jasmine.Clock.tick(50000)

        runs ->
          expect(chat.onConnected).toHaveBeenCalled()

      it 'emits join after joining a room', ->
        irc.doCommand 'JOIN', '#sugarman'
        waitsForArrayBufferConversion()
        runs ->
          expect(socket.received.callCount).toBe 1
          expect(socket.received.mostRecentCall.args).toMatch /JOIN #sugarman\s*/

      it "sends PRIVMSG on /say", ->
        irc.doCommand 'JOIN', '#sugarman'
        irc.doCommand 'PRIVMSG', '#sugarman', 'hello world'
        waitsForArrayBufferConversion()
        runs ->
          expect(socket.received.callCount).toBe 2
          expect(socket.received.mostRecentCall.args).toMatch /PRIVMSG #sugarman :hello world\s*/

      it "can join multiple channels and /say on all of them", ->
        irc.doCommand 'JOIN', '#sugarman'
        irc.doCommand 'JOIN', '#sugarman2'
        irc.doCommand 'PRIVMSG', '#sugarman', 'hello sugarman'
        irc.doCommand 'PRIVMSG', '#sugarman2', 'hello sugarman2'
        waitsForArrayBufferConversion()
        runs ->
          expect(socket.received.callCount).toBe 4
          expect(socket.received.argsForCall[0]).toMatch /JOIN #sugarman\s*/
          expect(socket.received.argsForCall[1]).toMatch /JOIN #sugarman2\s*/
          expect(socket.received.argsForCall[2]).toMatch /PRIVMSG #sugarman :hello sugarman\s*/
          expect(socket.received.argsForCall[3]).toMatch /PRIVMSG #sugarman2 :hello sugarman2\s*/

      it "responds to a PING with a PONG", ->
        socket.respondWithData "PING :#{(new Date()).getTime()}\r\n"

  it 'does nothing on non-connection commands when disconnected', ->
    irc.quit()
    irc.giveup()
    irc.doCommand 'NICK', 'sugarman'
    waitsForArrayBufferConversion()
    runs ->
      expect(irc.state).toBe 'disconnected'
