Skip to content

Commit

Permalink
Update spec to have received error when not enqueueing the message fr…
Browse files Browse the repository at this point in the history
…om the attempted duplicate event

Co-authored-by: Jane Sandberg <[email protected]>
Co-authored-by: Max Kadel <[email protected]>
  • Loading branch information
3 people committed Aug 22, 2024
1 parent e389893 commit 7bc9a8c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spec/services/aws_sqs_poller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@
let(:message_body) { JSON.parse(File.read(Rails.root.join('spec', 'fixtures', 'aws', 'sqs_incremental_dump.json'))).to_json }
context "with a duplicate event" do
before do
described_class.poll
Event.create!(message_body:)
end

it "doesn't raise an error or kicks off a background job" do
allow(Rails.logger).to receive(:error)
expect { described_class.poll }.not_to have_enqueued_job(
AlmaDumpTransferJob
)
expect(Rails.logger).to have_received(:error)
expect(Rails.logger).to have_received(:error).with("Rescue from AlmaDuplicateEventError with alma_process_id: 6587815790006421")
end
end

Expand All @@ -103,7 +103,6 @@
job_id:,
dump: instance_of(Dump)
)

expect(Dump.all.count).to eq 1
expect(Dump.first.dump_type).to eq 'changed_records'
event = Dump.first.event
Expand Down

0 comments on commit 7bc9a8c

Please sign in to comment.