spec/acceptance/rest/message_spec.rb in ably-1.0.2 vs spec/acceptance/rest/message_spec.rb in ably-1.0.3

- old
+ new

@@ -60,22 +60,25 @@ end end end context 'with supported extra payload content type (#RSL1h, #RSL6a2)' do + let(:channel) { client.channel("pushenabled:#{random_str}") } + context 'JSON Object (Hash)' do - let(:data) { { 'push' => { 'title' => 'Testing' } } } + let(:data) { { 'push' => { 'notification' => { 'title' => 'Testing' } } } } it 'is encoded and decoded to the same hash' do channel.publish 'event', {}, extras: data expect(channel.history.items.first.extras).to eql(data) end end context 'JSON Array' do - let(:data) { { 'push' => [ nil, true, false, 55, 'string', { 'Hash' => true }, ['array'] ] } } + # TODO: Add nil type back in + let(:data) { { 'push' => { 'data' => { 'key' => [ true, false, 55, 'string', { 'Hash' => true }, ['array'] ] } } } } - it 'is encoded and decoded to the same Array' do + it 'is encoded and decoded to the same deep multi-type object' do channel.publish 'event', {}, extras: data expect(channel.history.items.first.extras).to eql(data) end end