1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2026-03-04 06:44:06 +00:00

test: add tests for message unqueueing

This adds a comprehensive set of tests for the message unqueueing service.

Additionally, it improves how message databases are used for testing environments.
هذا الالتزام موجود في:
Adam Cooke
2024-02-19 22:27:22 +00:00
ملتزم من قبل Adam Cooke
الأصل 465f4d8247
التزام b4016f6b49
21 ملفات معدلة مع 1658 إضافات و84 حذوفات

عرض الملف

@@ -3,21 +3,20 @@
require "rails_helper"
describe OutgoingMessagePrototype do
let(:server) { create(:server) }
it "should create a new message" do
with_global_server do |server|
domain = create(:domain, owner: server)
prototype = OutgoingMessagePrototype.new(server, "127.0.0.1", "TestSuite", {
from: "test@#{domain.name}",
to: "test@example.com",
subject: "Test Message",
plain_body: "A plain body!"
})
domain = create(:domain, owner: server)
prototype = OutgoingMessagePrototype.new(server, "127.0.0.1", "TestSuite", {
from: "test@#{domain.name}",
to: "test@example.com",
subject: "Test Message",
plain_body: "A plain body!"
})
expect(prototype.valid?).to be true
message = prototype.create_message("test@example.com")
expect(message).to be_a Hash
expect(message[:id]).to be_a Integer
expect(message[:token]).to be_a String
end
expect(prototype.valid?).to be true
message = prototype.create_message("test@example.com")
expect(message).to be_a Hash
expect(message[:id]).to be_a Integer
expect(message[:token]).to be_a String
end
end