Testing Message Dequeuer Processing Workflow in Postal
This test suite examines the MessageDequeuer functionality in the Postal server application, focusing on message processing workflows. The tests verify proper initialization and execution of message processing with custom logging capabilities.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
postalserver/postal
spec/lib/message_dequeuer_spec.rb
# frozen_string_literal: true
require "rails_helper"
RSpec.describe MessageDequeuer do
describe ".process" do
it "calls the initial process with the given message and logger" do
message = create(:queued_message)
logger = TestLogger.new
mock = double("InitialProcessor")
expect(mock).to receive(:process).with(no_args)
expect(MessageDequeuer::InitialProcessor).to receive(:new).with(message, logger: logger).and_return(mock)
described_class.process(message, logger: logger)
end
end
end