spec/acceptance/realtime/message_spec.rb in ably-1.0.2 vs spec/acceptance/realtime/message_spec.rb in ably-1.0.3
- old
+ new
@@ -74,28 +74,31 @@
end
end
end
context 'with supported extra payload content type (#RTL6h, #RSL6a2)' do
+ let(:channel) { client.channel("pushenabled:#{random_str}") }
+
def publish_and_check_extras(extras)
channel.attach
channel.publish 'event', {}, extras: extras
channel.subscribe do |message|
expect(message.extras).to eql(extras)
stop_reactor
end
end
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
publish_and_check_extras 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
publish_and_check_extras data
end
end