Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lsiden/mail-store-agent
A mail store that is compatible with Mail::TestMailer and simulates mailboxes.
https://github.com/lsiden/mail-store-agent
Last synced: about 2 months ago
JSON representation
A mail store that is compatible with Mail::TestMailer and simulates mailboxes.
- Host: GitHub
- URL: https://github.com/lsiden/mail-store-agent
- Owner: lsiden
- Created: 2011-12-19T21:59:20.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2011-12-28T01:25:52.000Z (about 13 years ago)
- Last Synced: 2024-03-14T23:06:42.737Z (10 months ago)
- Language: Ruby
- Homepage:
- Size: 105 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkd
Awesome Lists containing this project
README
# MailStoreAgent
## Background
Most websites that authenticate users require some form of user account self-management.
Users need to register with e-mail and password, verify their e-mail address,
and to occasionally reset their e-mail and password.I like to delegate this to other services with [OpenID](http://en.wikipedia.org/wiki/OpenID)
and [OAuth](http://en.wikipedia.org/wiki/Oauth),
but not all clients agree to delegate ownership of their customers' authentication records.So I'm often stuck with implementing these boilerplace features yet again,
each of the above use-cases require sending out e-mails to confirm or facilitate.
Testing this can be a pain-in-the-butt.Fortunately, [Mikel Lindsaar](https://github.com/mikel)'s
[Mail](https://github.com/mikel/mail) gem
has a simple and effective way to store and not send e-mails in order to facilitate test scripts.Mail::TestMailer
Mail.defaults do
delivery_method :test
end# send a few mails ...
Mail::TestMailer.deliveries.is_a? Array # ==> true
Mail::TestMailer.deliveries.first.is_a? Mail::Message # ==> trueI want to take this a step further so that I can verify that mail got sent to the right people in the right order:
## SYNOPSIS
require 'mail'
require 'mail-store-agent'Mail.defaults do
delivery_method :test
endMail::TestMailer.deliveries = MailStoreAgent.new
# send some mail to [email protected], and then ...
Mail::TestMailer.deliveries.get('[email protected]').is_a? Mail::Message # or nil
## LICENSE
*
mail-store-agent.gem by Lawrence Siden is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at github.com.
* [Ruby License](http://www.ruby-lang.org/en/LICENSE.txt)