Permalink
Browse files

Added multiple toname test.

  • Loading branch information...
1 parent 3df4d2c commit 2034da29bc4849876b31269956c610496573062a Kav Latiolais committed May 16, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 test/lib/email.test.js
View
@@ -68,10 +68,16 @@ describe('Email', function () {
expect(webFormat.toname).to.be.empty;
});
it("should set a toname if one is provided", function() {
- var email = new Email({from: 'test@test.com', toname:'Tester T. Testerson', subject: 'testing', text: 'testing'});
+ var email = new Email({from: 'test@test.com', to:'test@test.com', toname:'Tester T. Testerson', subject: 'testing', text: 'testing'});
var webFormat = email.toWebFormat();
expect(webFormat.toname).to.equal('Tester T. Testerson');
});
+ it("should set multiple tonames if several are provided", function() {
+ var email = new Email({from: 'test@test.com', to: ['test@test.com', 'test2@test.com'], toname:['Tester T. Testerson', 'Test2 M. Testerson'], subject: 'testing', text: 'testing'});
+ var webFormat = email.toWebFormat();
+ expect(webFormat.toname[0]).to.equal('Tester T. Testerson');
+ expect(webFormat.toname[1]).to.equal('Test2 M. Testerson');
+ });
describe('files', function() {
it('should support adding attachments via path', function() {
var email = new Email();

0 comments on commit 2034da2

Please sign in to comment.