Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed broken test and regression re message de-duplication

  • Loading branch information...
commit 1945ab6afe31587c7ce4c905f8c37be7d8f3d0c0 1 parent a46bcec
Stevie Graham authored
1  example/ref.rb
View
@@ -3,6 +3,7 @@
require 'pusher'
require 'digest/md5'
require 'thin'
+require 'json'
set :views, File.dirname(__FILE__) + '/templates'
set :port, 3001
2  lib/slanger/handler.rb
View
@@ -26,7 +26,7 @@ def onmessage(msg)
event = msg['event'].gsub(/^pusher:/, 'pusher_')
if event =~ /^client-/
- msg['socket_id'] = @socket_id
+ msg['socket_id'] = connection.socket_id
Channel.send_client_message msg
elsif respond_to? event, true
send event, msg
16 spec/integration/private_channel_spec.rb
View
@@ -18,9 +18,9 @@
end
messages.should have_attributes connection_established: true,
- count: 2,
- id_present: true,
- last_event: 'pusher_internal:subscription_succeeded'
+ count: 2,
+ id_present: true,
+ last_event: 'pusher_internal:subscription_succeeded'
end
end
@@ -57,8 +57,8 @@
case client1_messages.length
when 1
private_channel client1, client1_messages.first
- else
- EM.stop
+ when 3
+ EM.next_tick { EM.stop }
end
end
@@ -72,9 +72,9 @@
end
end
- client1_messages.none? { |m| m['event'] == 'client-something' }
- client2_messages.one? { |m| m['event'] == 'client-something' }
+ client1_messages.one? { |m| m['event'] == 'client-something' }.should be_true
+ client2_messages.none? { |m| m['event'] == 'client-something' }.should be_true
end
end
end
- end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.