* fix websocket tests
This commit is contained in:
parent
39ed460d14
commit
74a27e14cf
|
|
@ -51,7 +51,7 @@ def login(router, user, password, client_id, token, client_type)
|
|||
args[0].should == client
|
||||
args[1].is_a?(Jampb::ClientMessage).should be_true
|
||||
end
|
||||
router.should_receive(:extract_ip).at_least(:once).with(client).and_return("127.0.0.1")
|
||||
router.should_receive(:extract_ip).at_least(:once).with(client, nil).and_return("127.0.0.1")
|
||||
client.should_receive(:onclose)
|
||||
client.should_receive(:onerror)
|
||||
|
||||
|
|
@ -61,6 +61,7 @@ def login(router, user, password, client_id, token, client_type)
|
|||
@router.new_client(client, false)
|
||||
handshake = double("handshake")
|
||||
handshake.should_receive(:query).exactly(3).times.and_return({ "pb" => "true", "channel_id" => SecureRandom.uuid, "client_id" => client_id, "token" => token, "client_type" => client_type })
|
||||
handshake.should_receive(:headers).at_least(:once).and_return({})
|
||||
client.onopenblock.call handshake
|
||||
|
||||
client
|
||||
|
|
@ -84,7 +85,7 @@ def login_latency_tester(router, latency_tester, client_id)
|
|||
args[0].should == client
|
||||
args[1].is_a?(Jampb::ClientMessage).should be_true
|
||||
end
|
||||
router.should_receive(:extract_ip).at_least(:once).with(client).and_return("127.0.0.1")
|
||||
router.should_receive(:extract_ip).at_least(:once).with(client, nil).and_return("127.0.0.1")
|
||||
client.should_receive(:onclose)
|
||||
client.should_receive(:onerror)
|
||||
|
||||
|
|
@ -93,6 +94,7 @@ def login_latency_tester(router, latency_tester, client_id)
|
|||
@router.new_client(client, true)
|
||||
handshake = double("handshake")
|
||||
handshake.should_receive(:query).exactly(3).times.and_return({ "pb" => "true", "channel_id" => SecureRandom.uuid, "client_type" => "latency_tester", "client_id" => client_id })
|
||||
handshake.should_receive(:headers).at_least(:once).and_return({})
|
||||
client.onopenblock.call handshake
|
||||
|
||||
client
|
||||
|
|
|
|||
Loading…
Reference in New Issue