spec/acceptance/rest/encoders_spec.rb in ably-0.8.8 vs spec/acceptance/rest/encoders_spec.rb in ably-0.8.9

- old
+ new

@@ -7,16 +7,16 @@ let(:client) { Ably::Rest::Client.new(default_client_options.merge(protocol: protocol)) } let(:channel_options) { {} } let(:channel) { client.channel('test', channel_options) } let(:response) { instance_double('Faraday::Response', status: 201) } - let(:cipher_params) { { key: random_str, algorithm: 'aes', mode: 'cbc', key_length: 128 } } + let(:cipher_params) { { key: Ably::Util::Crypto.generate_random_key(128), algorithm: 'aes', mode: 'cbc', key_length: 128 } } let(:crypto) { Ably::Util::Crypto.new(cipher_params) } let(:utf_8_data) { random_str.encode(Encoding::UTF_8) } let(:binary_data) { MessagePack.pack(random_str).encode(Encoding::ASCII_8BIT) } - let(:json_data) { { 'key' => random_str } } + let(:json_data) { { 'some_id' => random_str } } after do channel.publish 'event', published_data end @@ -68,11 +68,11 @@ end end end context 'with encryption' do - let(:channel_options) { { encrypted: true, cipher_params: cipher_params } } + let(:channel_options) { { cipher: cipher_params } } context 'with UTF-8 data' do let(:published_data) { utf_8_data } it 'applies utf-8 and cipher encoding and sets the encoding attribute to "utf-8/cipher+aes-128-cbc"' do @@ -144,10 +144,10 @@ end end end context 'with encryption' do - let(:channel_options) { { encrypted: true, cipher_params: cipher_params } } + let(:channel_options) { { cipher: cipher_params } } context 'with UTF-8 data' do let(:published_data) { utf_8_data } it 'applies utf-8, cipher and base64 encodings and sets the encoding attribute to "utf-8/cipher+aes-128-cbc/base64"' do