-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't pass a string as the enable_starttls_auto mailer parameter
- Loading branch information
Showing
4 changed files
with
42 additions
and
13 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
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 |
---|---|---|
|
@@ -14,7 +14,8 @@ | |
|
||
describe '#send' do | ||
|
||
let(:smtp_options) { { address: 'smtp.example.com', user_name: 'user', password: 'password' } } | ||
let(:enable_starttls_auto) { '0' } | ||
let(:smtp_options) { { address: 'smtp.example.com', user_name: 'user', password: 'password', enable_starttls_auto: enable_starttls_auto } } | ||
let(:options) { { to: '[email protected]', from: '[email protected]', subject: 'Hello world', body: 'Hello {{ to }}', smtp: smtp_options, html: false } } | ||
let(:context) { ::Liquid::Context.new({ 'name' => 'John', 'to' => '[email protected]' }, {}, {}) } | ||
|
||
|
@@ -30,12 +31,34 @@ | |
via_options: { | ||
address: 'smtp.example.com', | ||
user_name: 'user', | ||
password: 'password' | ||
password: 'password', | ||
enable_starttls_auto: false | ||
} | ||
}) | ||
subject | ||
end | ||
|
||
context "enable_starttls_auto is to '1'" do | ||
let(:enable_starttls_auto) { '1' } | ||
|
||
it 'sends the email over Pony' do | ||
expect(Pony).to receive(:mail).with({ | ||
to: '[email protected]', | ||
from: '[email protected]', | ||
subject: 'Hello world', | ||
body: 'Hello [email protected]', | ||
via: :smtp, | ||
via_options: { | ||
address: 'smtp.example.com', | ||
user_name: 'user', | ||
password: 'password', | ||
enable_starttls_auto: true | ||
} | ||
}) | ||
subject | ||
end | ||
end | ||
|
||
context 'simulation mode' do | ||
|
||
let(:simulation) { true } | ||
|
@@ -70,7 +93,8 @@ | |
via_options: { | ||
address: 'smtp.example.com', | ||
user_name: 'user', | ||
password: 'password' | ||
password: 'password', | ||
enable_starttls_auto: false | ||
} | ||
}) | ||
subject | ||
|
@@ -110,7 +134,8 @@ | |
via_options: { | ||
address: 'smtp.example.com', | ||
user_name: 'user', | ||
password: 'password' | ||
password: 'password', | ||
enable_starttls_auto: false | ||
} | ||
}) | ||
subject | ||
|
@@ -134,7 +159,8 @@ | |
via_options: { | ||
address: 'smtp.example.com', | ||
user_name: 'user', | ||
password: 'password' | ||
password: 'password', | ||
enable_starttls_auto: false | ||
} | ||
}) | ||
subject | ||
|
@@ -154,7 +180,8 @@ | |
via_options: { | ||
address: 'smtp.example.com', | ||
user_name: 'user', | ||
password: 'password' | ||
password: 'password', | ||
enable_starttls_auto: false | ||
} | ||
}) | ||
subject | ||
|
@@ -179,7 +206,8 @@ | |
via_options: { | ||
address: 'smtp.example.com', | ||
user_name: 'user', | ||
password: 'password' | ||
password: 'password', | ||
enable_starttls_auto: false | ||
} | ||
}) | ||
subject | ||
|
@@ -190,9 +218,4 @@ | |
end | ||
|
||
end | ||
|
||
def default_options | ||
|
||
end | ||
|
||
end |