-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specify that domain should be nil if MAILGUN_SMTP_LOGIN not set
- Loading branch information
Showing
3 changed files
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,12 @@ def expect(request_class, arg) | |
|
||
Mailgunner::Client.new(api_key: @api_key).domain.must_equal(@domain) | ||
end | ||
|
||
it 'defaults to nil if the MAILGUN_SMTP_LOGIN environment variable does not exist' do | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
timcraft
Author
Member
|
||
ENV.delete('MAILGUN_SMTP_LOGIN') | ||
|
||
Mailgunner::Client.new(api_key: @api_key).domain.must_be_nil | ||
end | ||
end | ||
|
||
describe 'api_key method' do | ||
|
why should
domain
allowed to benil
? I would suggest raising an error.if it's only for email validation, then I'd be willing to refactor email validation to a new class and submit a pull request.
note: this 'feature' cost quite a bit of time trying to debug what was happening: Mailgunner gem was initialized before
MAILGUN_SMTP_LOGIN
was pulled in fromdotenv
gem