-
Notifications
You must be signed in to change notification settings - Fork 780
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Attachment class create method for Mail class
- Loading branch information
1 parent
07b4f71
commit e027c48
Showing
4 changed files
with
34 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -185,6 +185,23 @@ describe('Mail', function() { | |
}], | ||
})).to.throw('filename'); | ||
}); | ||
|
||
it('properly handles attachment contentId', () => { | ||
const contentId = 'test-content-id'; | ||
const mail = new Mail({ | ||
to: '[email protected]', | ||
attachments: [{ | ||
disposition: 'inline', | ||
content: 'test-content', | ||
filename: 'name-that-file', | ||
type: 'file-type', | ||
contentId, | ||
}], | ||
}); | ||
const mainJSON = mail.toJSON(); | ||
const firstAttachment = mainJSON.attachments[0]; | ||
expect(firstAttachment.content_id).to.equal(contentId); | ||
}); | ||
}); | ||
}); | ||
|
||
|