Fixed unit tests.

This commit is contained in:
Martin Edenhofer 2014-10-14 01:58:21 +02:00
parent f22a87c99f
commit 9742f5f0b2
3 changed files with 6 additions and 6 deletions

View file

@ -479,7 +479,7 @@ returns
next if !session_data
next if !session_data[:user]
next if !session_data[:user]['id']
user = User.lookup( session_data[:user]['id'] )
user = User.lookup( :id => session_data[:user]['id'] )
next if !user
# start client thread

View file

@ -27,8 +27,8 @@ class Sessions::Client
session_data = Sessions.get( @client_id )
return if !session_data
return if !session_data[:user]
return if !session_data[:user][:id]
user = User.lookup( :id => session_data[:user][:id] )
return if !session_data[:user]['id']
user = User.lookup( :id => session_data[:user]['id'] )
return if !user
# init new backends

View file

@ -83,17 +83,17 @@ class SessionEnhancedTest < ActiveSupport::TestCase
data = Sessions.get(client_id1)
assert( data[:meta], "check if meta exists" )
assert( data[:user], "check if user exists" )
assert_equal( data[:user][:id], agent1.id, "check if user id is correct" )
assert_equal( data[:user]['id'], agent1.id, "check if user id is correct" )
data = Sessions.get(client_id2)
assert( data[:meta], "check if meta exists" )
assert( data[:user], "check if user exists" )
assert_equal( data[:user][:id], agent2.id, "check if user id is correct" )
assert_equal( data[:user]['id'], agent2.id, "check if user id is correct" )
data = Sessions.get(client_id3)
assert( data[:meta], "check if meta exists" )
assert( data[:user], "check if user exists" )
assert_equal( data[:user][:id], agent3.id, "check if user id is correct" )
assert_equal( data[:user]['id'], agent3.id, "check if user id is correct" )
# send data to one client
Sessions.send( client_id1, { :msg => 'äöüß123' } )