aboutsummaryrefslogtreecommitdiffstats
path: root/test/controllers/ingresses/mandrill/inbound_emails_controller_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/controllers/ingresses/mandrill/inbound_emails_controller_test.rb')
-rw-r--r--test/controllers/ingresses/mandrill/inbound_emails_controller_test.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/controllers/ingresses/mandrill/inbound_emails_controller_test.rb b/test/controllers/ingresses/mandrill/inbound_emails_controller_test.rb
index 1658d85104..c8a8e731d6 100644
--- a/test/controllers/ingresses/mandrill/inbound_emails_controller_test.rb
+++ b/test/controllers/ingresses/mandrill/inbound_emails_controller_test.rb
@@ -1,9 +1,10 @@
require "test_helper"
-ActionMailbox::Ingresses::Mandrill::InboundEmailsController::Authenticator.key = "1l9Qf7lutEf7h73VXfBwhw"
+ENV["MANDRILL_INGRESS_API_KEY"] = "1l9Qf7lutEf7h73VXfBwhw"
class ActionMailbox::Ingresses::Mandrill::InboundEmailsControllerTest < ActionDispatch::IntegrationTest
setup do
+ ActionMailbox.ingress = :mandrill
@events = JSON.generate([{ event: "inbound", msg: { raw_msg: file_fixture("../files/welcome.eml").read } }])
end
@@ -48,12 +49,10 @@ class ActionMailbox::Ingresses::Mandrill::InboundEmailsControllerTest < ActionDi
end
private
- delegate :key, :key=, to: ActionMailbox::Ingresses::Mandrill::InboundEmailsController::Authenticator
-
def switch_key_to(new_key)
- previous_key, self.key = key, new_key
+ previous_key, ENV["MANDRILL_INGRESS_API_KEY"] = ENV["MANDRILL_INGRESS_API_KEY"], new_key
yield
ensure
- self.key = previous_key
+ ENV["MANDRILL_INGRESS_API_KEY"] = previous_key
end
end