lib/submodules/ably-ruby/spec/acceptance/rest/presence_spec.rb in ably-rest-0.8.6 vs lib/submodules/ably-ruby/spec/acceptance/rest/presence_spec.rb in ably-rest-0.8.9

- old
+ new

@@ -24,12 +24,12 @@ let(:mode) { cipher_details.fetch('mode').upcase } let(:key_length) { cipher_details.fetch('keylength') } let(:secret_key) { Base64.decode64(cipher_details.fetch('key')) } let(:iv) { Base64.decode64(cipher_details.fetch('iv')) } - let(:cipher_options) { { key: secret_key, algorithm: algorithm, mode: mode, key_length: key_length, iv: iv } } - let(:fixtures_channel) { client.channel('persisted:presence_fixtures', encrypted: true, cipher_params: cipher_options, iv: iv) } + let(:cipher_options) { { key: secret_key, algorithm: algorithm, mode: mode, key_length: key_length, fixed_iv: iv } } + let(:fixtures_channel) { client.channel('persisted:presence_fixtures', cipher: cipher_options, fixed_iv: iv) } context 'tested against presence fixture data set up in test app' do before(:context) do # When this test is run as a part of a test suite, the presence data injected in the test app may have expired reload_test_app @@ -319,11 +319,11 @@ Ably::Rest::Client.new(client_options.merge(key: "#{user}:#{secret}")) end let(:data) { random_str(32) } let(:channel_name) { "persisted:#{random_str(4)}" } - let(:cipher_options) { { key: random_str(32), algorithm: 'aes', mode: 'cbc', key_length: 256 } } - let(:presence) { client.channel(channel_name, encrypted: true, cipher_params: cipher_options).presence } + let(:cipher_options) { { key: Ably::Util::Crypto.generate_random_key(256), algorithm: 'aes', mode: 'cbc', key_length: 256 } } + let(:presence) { client.channel(channel_name, cipher: cipher_options).presence } let(:crypto) { Ably::Util::Crypto.new(cipher_options) } let(:content_type) do if protocol == :msgpack