-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sending attachments less than 3MB (#483)
We were not encoding the attachments properly for attachments less than 3MB. They should be b64 encoded. Now it should handle it correctly.
- Loading branch information
1 parent
03b5a60
commit 905072d
Showing
7 changed files
with
178 additions
and
33 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
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 |
---|---|---|
|
@@ -100,6 +100,8 @@ | |
it "calls the post method with the correct parameters for small attachments" do | ||
identifier = "abc-123-grant-id" | ||
mock_file = instance_double("file") | ||
allow(mock_file).to receive(:read).and_return("file content") | ||
allow(mock_file).to receive(:close).and_return(true) | ||
request_body = { | ||
subject: "Hello from Nylas!", | ||
to: [{ name: "Jon Snow", email: "[email protected]" }], | ||
|
@@ -183,6 +185,8 @@ | |
identifier = "abc-123-grant-id" | ||
draft_id = "5d3qmne77v32r8l4phyuksl2x" | ||
mock_file = instance_double("file") | ||
allow(mock_file).to receive(:read).and_return("file content") | ||
allow(mock_file).to receive(:close).and_return(true) | ||
request_body = { | ||
subject: "Hello from Nylas!", | ||
to: [{ name: "Jon Snow", email: "[email protected]" }], | ||
|
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 |
---|---|---|
|
@@ -140,6 +140,8 @@ | |
it "calls the post method with the correct parameters and attachments" do | ||
identifier = "abc-123-grant-id" | ||
mock_file = instance_double("file") | ||
allow(mock_file).to receive(:read).and_return("file content") | ||
allow(mock_file).to receive(:close).and_return(true) | ||
request_body = { | ||
subject: "Hello from Nylas!", | ||
to: [{ name: "Jon Snow", email: "[email protected]" }], | ||
|
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