مراية لـ
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.
هذا الالتزام موجود في:
@@ -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
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم