2015-04-12 91 views

回答

1

您可以使用夹具和重写电子邮件发送功能是这样的:

Email.send = function (options) { 
    // store those somewhere like an emailsCollection 
    emailsCollection.insert(options); 
}; 

现在你可以在emailsCollection断言在测试中