spec/acceptance/realtime/message_spec.rb in ably-0.7.5 vs spec/acceptance/realtime/message_spec.rb in ably-0.7.6

- old
+ new

@@ -4,11 +4,11 @@ require 'json' require 'securerandom' describe 'Ably::Realtime::Channel Message', :event_machine do vary_by_protocol do - let(:default_options) { options.merge(api_key: api_key, environment: environment, protocol: protocol) } + let(:default_options) { options.merge(key: api_key, environment: environment, protocol: protocol) } let(:client_options) { default_options } let(:client) do Ably::Realtime::Client.new(client_options) end let(:channel) { client.channel(channel_name) } @@ -75,12 +75,12 @@ end context 'when retrieved over REST' do it 'matches the sender connection#id' do channel.publish('event', payload) do - channel.history do |messages| - expect(messages.first.connection_id).to eql(client.connection.id) + channel.history do |page| + expect(page.items.first.connection_id).to eql(client.connection.id) stop_reactor end end end end @@ -173,11 +173,11 @@ end end context 'without suitable publishing permissions' do let(:restricted_client) do - Ably::Realtime::Client.new(options.merge(api_key: restricted_api_key, environment: environment, protocol: protocol)) + Ably::Realtime::Client.new(options.merge(key: restricted_api_key, environment: environment, protocol: protocol)) end let(:restricted_channel) { restricted_client.channel("cansubscribe:example") } let(:payload) { 'Test message without permission to publish' } it 'calls the error callback' do @@ -291,10 +291,10 @@ end end end end - resources_root = File.expand_path('../../../resources', __FILE__) + resources_root = File.expand_path('../../../../lib/submodules/ably-common/test-resources', __FILE__) def self.add_tests_for_data(data) data['items'].each_with_index do |item, index| context "item #{index} with encrypted encoding #{item['encrypted']['encoding']}" do it_behaves_like 'an Ably encrypter and decrypter', item, data