Permalink
Browse files

moved helper method

  • Loading branch information...
markburns authored and stevegraham committed Apr 7, 2012
1 parent 871e703 commit 8abd44f5e6ed39270fb1411b97a8cfbdfaee8cc7
Showing with 9 additions and 8 deletions.
  1. +9 −0 spec/event_machine_helper_methods.rb
  2. +0 −8 spec/integration/integration_spec.rb
@@ -50,6 +50,15 @@ def send_subscribe options
data: {channel: 'presence-channel'}.merge(auth)}.to_json)
end
def private_channel websocket, message
auth = Pusher['private-channel'].authenticate(message['data']['socket_id'])[:auth]
websocket.send({ event: 'pusher:subscribe',
data: { channel: 'private-channel',
auth: auth } }.to_json)
end
def matcher messages, options
messages.first['event'].should == 'pusher:connection_established' if options[:connection_established]
messages.first['data']['socket_id'].should_not be_nil if options[:id_present]
@@ -97,14 +97,6 @@
end
end
def private_channel websocket, message
auth = Pusher['private-channel'].authenticate(message['data']['socket_id'])[:auth]
websocket.send({ event: 'pusher:subscribe',
data: { channel: 'private-channel',
auth: auth } }.to_json)
end
describe 'private channels' do
context 'with valid authentication credentials:' do
it 'accepts the subscription request' do

0 comments on commit 8abd44f

Please sign in to comment.