1
0
mirror of https://github.com/meineerde/rackstash.git synced 2025-12-19 15:01:12 +00:00

Test JSON encoder behavior with a missing timestamp

This commit is contained in:
Holger Just 2018-01-27 00:47:25 +01:00
parent 952ecd5c73
commit 1d16d366a0

View File

@ -40,5 +40,13 @@ describe Rackstash::Encoder::JSON do
expect(encoder.encode(event))
.to eql '{"message":"line1\nline2\n","@timestamp":"2016-10-17T10:37:00.000000Z"}'
end
it 'omits a missing timestamp' do
event = { 'foo' => 'bar' }
expect(encoder.encode(event))
.to eql '{"foo":"bar"}'
end
end
end