spec/backends/db_spec.rb in deimos-ruby-1.0.0.pre.beta22 vs spec/backends/db_spec.rb in deimos-ruby-1.0.0.pre.beta23
- old
+ new
@@ -21,9 +21,16 @@
'message' => '{"foo"=>3}',
'topic' => 'my-topic',
'key' => 'foo3'
)
end
+
+ it 'should add nil messages' do
+ described_class.publish(producer_class: MyProducer,
+ messages: [build_message(nil, 'my-topic', "foo1")])
+ expect(Deimos::KafkaMessage.count).to eq(1)
+ end
+
it 'should add to non-keyed messages' do
described_class.publish(producer_class: MyNoKeyProducer,
messages: messages)
expect(Deimos::KafkaMessage.count).to eq(3)
described_class.publish(producer_class: MyNoKeyProducer,