spec/unit/models/message_spec.rb in ably-1.1.7 vs spec/unit/models/message_spec.rb in ably-1.1.8

- old
+ new

@@ -604,6 +604,30 @@ last = from_encoded.last expect(last.name).to eql('name2') end end end + + context '#delta_extras (TM2i)' do + let(:delta_extras) { message.delta_extras } + + context 'when delta' do + let(:message) { subject.new({ extras: { delta: { from: '1234-1234-5678-9009', format: 'vcdiff' } } }) } + + it 'should return vcdiff format' do + expect(delta_extras.format).to eq('vcdiff') + end + + it 'should return 1234-1234-5678-9009 message id' do + expect(delta_extras.from).to eq('1234-1234-5678-9009') + end + end + + context 'when no delta' do + let(:message) { subject.new({ extras: {} }) } + + it 'should return nil' do + expect(delta_extras).to eq(nil) + end + end + end end