Skip to content

Commit

Permalink
Add test for retry_queue
Browse files Browse the repository at this point in the history
  • Loading branch information
swistak35 committed Dec 17, 2021
1 parent ff76c27 commit 0bf3dc8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions contrib/ruby_event_store-outbox/spec/sidekiq_scheduler_spec.rb
Expand Up @@ -98,6 +98,22 @@ def through_outbox?; true; end
expect(record.hash_payload[:queue]).to eq("custom_queue")
end

specify "custom retry queue name is taken into account" do
event = TimeEnrichment.with(Event.new(event_id: "83c3187f-84f6-4da7-8206-73af5aca7cc8"), timestamp: Time.utc(2019, 9, 30))
serialized_record = RubyEventStore::Mappers::Default.new.event_to_record(event).serialize(YAML)
class ::CorrectAsyncHandlerWithRetryQueue
include Sidekiq::Worker
sidekiq_options queue: 'custom_queue', retry_queue: 'custom_queue_retries'
def through_outbox?; true; end
end

subject.call(CorrectAsyncHandlerWithRetryQueue, serialized_record)

record = Repository::Record.first
expect(record.split_key).to eq('custom_queue')
expect(record.hash_payload[:retry_queue]).to eq("custom_queue_retries")
end

specify "client middleware may abort scheduling" do
event = TimeEnrichment.with(Event.new(event_id: "83c3187f-84f6-4da7-8206-73af5aca7cc8"), timestamp: Time.utc(2019, 9, 30))
event_record = RubyEventStore::Mappers::Default.new.event_to_record(event)
Expand Down

0 comments on commit 0bf3dc8

Please sign in to comment.