* fixing websocket tests

This commit is contained in:
Seth Call 2014-12-18 16:26:56 -06:00
parent 08a266a203
commit 3bac8252e9
2 changed files with 8 additions and 7 deletions

View File

@ -389,9 +389,9 @@ SQL
end
def lock_connections(conn)
if APP_CONFIG.lock_connections
conn.exec("LOCK connections IN EXCLUSIVE MODE").clear
end
#if APP_CONFIG.lock_connections
# conn.exec("LOCK connections IN EXCLUSIVE MODE").clear
#end
end
# def associate_tracks(connection, tracks)

View File

@ -2,11 +2,11 @@ require 'spec_helper'
require 'thread'
LoginClient = Class.new do
attr_accessor :onmsgblock, :onopenblock, :encode_json, :channel_id, :client_id, :user_id, :context, :trusted
attr_accessor :onmsgblock, :onopenblock, :encode_json, :channel_id, :client_id, :user_id, :context, :trusted, :subscriptions
def initialize()
@subscriptions = Set.new
end
def connected?
@ -150,6 +150,7 @@ describe Router do
context = ClientContext.new(user, client, "client")
client.should_receive(:context).any_number_of_times.and_return(context)
client.should_receive(:close)
client.should_receive(:subscriptions).and_return(Set.new)
conn1 = FactoryGirl.create(:connection, :user => user, :client_id => "pc1")
client.should_receive(:client_id).and_return(conn1.client_id)
@router.add_tracker(user, client, 'client', conn1.client_id)
@ -214,10 +215,10 @@ describe Router do
#em do
TestClient = Class.new do
attr_accessor :onmsgblock, :onopenblock, :encode_json, :client_id
attr_accessor :onmsgblock, :onopenblock, :encode_json, :client_id, :subscriptions
def initialize()
@subscriptions = Set.new
end
def onopen(&block)