Skip to content

Commit 6a1444a

Browse files
committed
Don't require secrets in the test environment
1 parent 962e366 commit 6a1444a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/models/speaker_mailer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class SpeakerMailer < ActionMailer::Base
77
include ActionView::Helpers::SanitizeHelper
88

99
def self.configured?
10-
if SECRETS.email.blank? || SECRETS.email['action_mailer'].blank? || SECRETS.email['default_from_address'] == 'test'
10+
if !Rails.env.test? && (SECRETS.email.blank? || SECRETS.email['action_mailer'].blank? || SECRETS.email['default_from_address'] == 'test')
1111
return false
1212
else
1313
return true

spec/models/speaker_mailer_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def deliver_email(proposal)
2525

2626
context "when sending email" do
2727
it "should raise error if speaker_mailer is not configured" do
28-
SECRETS.stub(:email).and_return({})
28+
SpeakerMailer.stub(:configured?).and_return(false)
2929
lambda { deliver_email(@proposal) }.should raise_error(ArgumentError)
3030
end
3131

0 commit comments

Comments
 (0)