diff --git a/lib/postal/rspec_helpers.rb b/lib/postal/rspec_helpers.rb deleted file mode 100644 index fd55188..0000000 --- a/lib/postal/rspec_helpers.rb +++ /dev/null @@ -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 diff --git a/spec/helpers/general_helpers.rb b/spec/helpers/general_helpers.rb new file mode 100644 index 0000000..0b982f5 --- /dev/null +++ b/spec/helpers/general_helpers.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module GeneralHelpers + + 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 diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 4a5d93e..8827741 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -32,7 +32,7 @@ RSpec.configure do |config| config.use_transactional_fixtures = true config.infer_spec_type_from_file_location! config.include FactoryBot::Syntax::Methods - config.include Postal::RspecHelpers + config.include GeneralHelpers config.before(:suite) do # Test that the factories are working as they should and then clean up before getting started on