-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
raise error when email address is invalid
- Loading branch information
Showing
2 changed files
with
31 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,5 +142,15 @@ | |
# (There will be a "'from' is required" error from the server) | ||
its(:from) { is_expected.to be_nil } | ||
end | ||
|
||
%i[from to cc bcc].each do |header| | ||
context "when '#{header}' is invalid" do | ||
let(:message_params) { super().merge(header => 'invalid [email protected]') } | ||
|
||
it 'raises an error' do | ||
expect { mail }.to raise_error(Mailtrap::Error, "failed to parse '#{header}': 'invalid [email protected]'") | ||
end | ||
end | ||
end | ||
end | ||
end |