forked from sendgrid/sendgrid-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test to have parity with Hello World README example
- Loading branch information
1 parent
e2d0d47
commit 2663a0a
Showing
1 changed file
with
7 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,15 +9,13 @@ def setup | |
end | ||
|
||
def test_hello_world | ||
mail = Mail.new | ||
mail.from = Email.new(email: "[email protected]") | ||
mail.subject = "Hello World from the SendGrid Ruby Library" | ||
personalization = Personalization.new | ||
personalization.add_to(Email.new(email: "[email protected]")) | ||
mail.add_personalization(personalization) | ||
mail.add_content(Content.new(type: "text/plain", value: "some text here")) | ||
mail.add_content(Content.new(type: "text/html", value: "<html><body>some text here</body></html>")) | ||
assert_equal(mail.to_json, JSON.parse('{"content":[{"type":"text/plain","value":"some text here"},{"type":"text/html","value":"<html><body>some text here</body></html>"}],"from":{"email":"[email protected]"},"personalizations":[{"to":[{"email":"[email protected]"}]}],"subject":"Hello World from the SendGrid Ruby Library"}')) | ||
from = Email.new(email: '[email protected]') | ||
to = Email.new(email: '[email protected]') | ||
subject = 'Sending with SendGrid is Fun' | ||
content = Content.new(type: 'text/plain', value: 'and easy to do anywhere, even with Ruby') | ||
mail = Mail.new(from, subject, to, content) | ||
|
||
assert_equal(mail.to_json, JSON.parse('{"from":{"email":"[email protected]"}, "subject":"Sending with SendGrid is Fun", "personalizations":[{"to":[{"email":"[email protected]"}]}], "content":[{"type":"text/plain", "value":"and easy to do anywhere, even with Ruby"}]}')) | ||
end | ||
|
||
def test_kitchen_sink | ||
|