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

- old
+ new

@@ -5,11 +5,11 @@ describe Ably::Realtime::Connection, :event_machine do let(:connection) { client.connection } vary_by_protocol do let(:default_options) do - { api_key: api_key, environment: environment, protocol: protocol } + { key: api_key, environment: environment, protocol: protocol } end let(:client_options) { default_options } let(:client) { Ably::Realtime::Client.new(client_options) } @@ -136,15 +136,15 @@ end end context 'when connected with a valid non-expired token' do context 'that then expires following the connection being opened' do - let(:ttl) { 2 } + let(:ttl) { 5 } let(:channel) { client.channel('test') } context 'the server' do - it 'disconnects the client, and the client automatically renews the token and then reconnects', em_timeout: 10 do + it 'disconnects the client, and the client automatically renews the token and then reconnects', em_timeout: 15 do original_token = client.auth.current_token expect(original_token).to_not be_expired connection.once(:connected) do started_at = Time.now @@ -175,10 +175,10 @@ let!(:expired_token) do Ably::Realtime::Client.new(default_options).auth.request_token(ttl: 0.01) end context 'opening a new connection' do - let(:client_options) { default_options.merge(api_key: nil, token_id: expired_token.id, log_level: :none) } + let(:client_options) { default_options.merge(key: nil, token_id: expired_token.id, log_level: :none) } it 'transitions state to failed', em_timeout: 10 do EventMachine.add_timer(1) do # wait for token to expire expect(expired_token).to be_expired connection.once(:connected) { raise 'Connection should never connect as token has expired' }