 				constructorSpy = spyOn(global, 'FakeRTCPeerConnection').andCallThrough()
 				FakeRTCPeerConnection.prototype = originalPrototype
 
-				remote = new Peer(fakeController, '1', true, FakeRTCPeerConnection)
+				peer = new Peer(fakeController, '1', true, FakeRTCPeerConnection)
 				expect(constructorSpy).toHaveBeenCalled()
 
 				callArgs = FakeRTCPeerConnection.mostRecentCall.args


	describe 'Remote.Peer', ->

		remote = null
		fakeController = null

		# Fake RTCPeerConnection object to prevent actually connecting with something

				expect(callArgs[0]).toEqual(Peer.prototype._serverConfiguration)
				expect(callArgs[1]).toEqual(Peer.prototype._connectionConfiguration)

				expect(peer._connection.onicecandidate).toEqual(peer._onIceCandidate)
				expect(peer._connection.oniceconnectionstatechange).toEqual(peer._onIceConnectionStateChange)
				expect(peer._connection.ondatachannel).toEqual(peer._onDataChannel)

			it 'should listen on all RTC connection events', ->
				spyOn(Peer.prototype, '_onConnect')
				spyOn(Peer.prototype, '_onDisconnect')
				spyOn(Peer.prototype, '_onChannelOpened')
				spyOn(Peer.prototype, '_onChannelClosed')
				peer = new Peer(fakeController, '1', true, FakeRTCPeerConnection)

				peer.trigger('connect')
				peer.trigger('disconnect')
				peer.trigger('channel.opened')
				peer.trigger('channel.closed')

				expect(peer._onConnect).toHaveBeenCalled()
				expect(peer._onDisconnect).toHaveBeenCalled()
				expect(peer._onChannelOpened).toHaveBeenCalled()
				expect(peer._onChannelClosed).toHaveBeenCalled()