From 3f48078cf0433c9ed3049ebae3b20ae7d9bf6693 Mon Sep 17 00:00:00 2001 From: yuenmichelle1 Date: Tue, 19 Dec 2023 13:38:53 -0600 Subject: [PATCH] add spec to check if it at least dedupes --- spec/models/kinesis_stream_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/models/kinesis_stream_spec.rb b/spec/models/kinesis_stream_spec.rb index 56afbf9..2be5a1d 100644 --- a/spec/models/kinesis_stream_spec.rb +++ b/spec/models/kinesis_stream_spec.rb @@ -71,5 +71,17 @@ end.to change(ClassificationUserGroup, :count).from(0).to(1) end end + + context 'payload has duplicates' do + it 'dedupes classification_events' do + kinesis_stream.create_events([classification_payload, classification_payload]) + expect(kinesis_stream.instance_variable_get(:@classification_events).length).to eq(1) + end + + it 'dedupes comment_events' do + kinesis_stream.create_events([comment_payload, comment_payload, comment_payload]) + expect(kinesis_stream.instance_variable_get(:@comment_events).length).to eq(1) + end + end end end