From 37687e32a114d0d62bbcef1092d09184ec81b835 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 9 Sep 2019 14:45:44 +0200 Subject: [PATCH] Fixed mail delivery postmaster to sender test. --- test/integration/email_deliver_test.rb | 6 +++++- test/integration/email_postmaster_to_sender.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/integration/email_deliver_test.rb b/test/integration/email_deliver_test.rb index 1adf43d80..5fd60e1f6 100644 --- a/test/integration/email_deliver_test.rb +++ b/test/integration/email_deliver_test.rb @@ -11,12 +11,16 @@ class EmailDeliverTest < ActiveSupport::TestCase raise "Need MAIL_SERVER_ACCOUNT as ENV variable like export MAIL_SERVER_ACCOUNT='user:somepass'" end + if ENV['MAIL_SERVER_EMAIL'].blank? + raise "Need MAIL_SERVER_EMAIL as ENV variable like export MAIL_SERVER_EMAIL='someunitest@example.com'" + end + server_login = ENV['MAIL_SERVER_ACCOUNT'].split(':')[0] server_password = ENV['MAIL_SERVER_ACCOUNT'].split(':')[1] email_address = EmailAddress.create!( realname: 'me Helpdesk', - email: "me#{rand(999_999_999)}@example.com", + email: "some-zammad-#{ENV['MAIL_SERVER_EMAIL']}", updated_by_id: 1, created_by_id: 1, ) diff --git a/test/integration/email_postmaster_to_sender.rb b/test/integration/email_postmaster_to_sender.rb index 14521c2cf..b51de4db9 100644 --- a/test/integration/email_postmaster_to_sender.rb +++ b/test/integration/email_postmaster_to_sender.rb @@ -30,7 +30,7 @@ class EmailPostmasterToSender < ActiveSupport::TestCase @email_address = EmailAddress.create!( realname: 'me Helpdesk', - email: "me#{@test_id}@example.com", + email: "some-zammad-#{ENV['MAIL_SERVER_EMAIL']}", updated_by_id: 1, created_by_id: 1, )