test: move Postal::RpecHelpers to spec/helpers

This commit is contained in:
Adam Cooke
2024-02-23 22:51:35 +00:00
committed by Adam Cooke
parent 1a4158699c
commit ee86311525
3 changed files with 16 additions and 18 deletions
-17
View File
@@ -1,17 +0,0 @@
# frozen_string_literal: true
module Postal
module RspecHelpers
def create_plain_text_message(server, text, to = "test@example.com", override_attributes = {})
domain = create(:domain, owner: server)
attributes = { from: "test@#{domain.name}", subject: "Test Plain Text Message" }.merge(override_attributes)
attributes[:to] = to
attributes[:plain_body] = text
message = OutgoingMessagePrototype.new(server, "127.0.0.1", "testsuite", attributes)
result = message.create_message(to)
server.message_db.message(result[:id])
end
end
end