lib/submodules/ably-ruby/spec/acceptance/realtime/presence_spec.rb in ably-rest-0.7.5 vs lib/submodules/ably-ruby/spec/acceptance/realtime/presence_spec.rb in ably-rest-0.8.1
- old
+ new
@@ -3,11 +3,11 @@
describe Ably::Realtime::Presence, :event_machine do
include Ably::Modules::Conversions
vary_by_protocol do
- let(:default_options) { { api_key: api_key, environment: environment, protocol: protocol } }
+ let(:default_options) { { key: api_key, environment: environment, protocol: protocol } }
let(:client_options) { default_options }
let(:anonymous_client) { Ably::Realtime::Client.new(client_options) }
let(:client_one) { Ably::Realtime::Client.new(client_options.merge(client_id: random_str)) }
let(:client_two) { Ably::Realtime::Client.new(client_options.merge(client_id: random_str)) }
@@ -485,11 +485,11 @@
stop_reactor
end
context 'without necessary capabilities to join presence' do
let(:restricted_client) do
- Ably::Realtime::Client.new(default_options.merge(api_key: restricted_api_key, log_level: :fatal))
+ Ably::Realtime::Client.new(default_options.merge(key: restricted_api_key, log_level: :fatal))
end
let(:restricted_channel) { restricted_client.channel("cansubscribe:channel") }
let(:restricted_presence) { restricted_channel.presence }
it 'calls the Deferrable errback on capabilities failure' do
@@ -686,11 +686,11 @@
it_should_behave_like 'a public presence method', :enter_client, nil, 'client_id'
context 'without necessary capabilities to enter on behalf of another client' do
let(:restricted_client) do
- Ably::Realtime::Client.new(default_options.merge(api_key: restricted_api_key, log_level: :fatal))
+ Ably::Realtime::Client.new(default_options.merge(key: restricted_api_key, log_level: :fatal))
end
let(:restricted_channel) { restricted_client.channel("cansubscribe:channel") }
let(:restricted_presence) { restricted_channel.presence }
it 'calls the Deferrable errback on capabilities failure' do
@@ -1121,12 +1121,12 @@
end
context 'REST #get' do
it 'returns current members' do
presence_client_one.enter(data: data_payload) do
- members = channel_rest_client_one.presence.get
- this_member = members.first
+ members_page = channel_rest_client_one.presence.get
+ this_member = members_page.items.first
expect(this_member).to be_a(Ably::Models::PresenceMessage)
expect(this_member.client_id).to eql(client_one.client_id)
expect(this_member.data).to eql(data_payload)
@@ -1135,12 +1135,12 @@
end
it 'returns no members once left' do
presence_client_one.enter(data: data_payload) do
presence_client_one.leave do
- members = channel_rest_client_one.presence.get
- expect(members.count).to eql(0)
+ members_page = channel_rest_client_one.presence.get
+ expect(members_page.items.count).to eql(0)
stop_reactor
end
end
end
end
@@ -1262,10 +1262,10 @@
end
context 'REST #get' do
it 'returns a list of members with decrypted data' do
encrypted_channel.presence.enter(data: data) do
- member = channel_rest_client_one.presence.get.first
+ member = channel_rest_client_one.presence.get.items.first
expect(member.encoding).to be_nil
expect(member.data).to eql(data)
stop_reactor
end
end