Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

shoulda_action_mailer

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shoulda_action_mailer

  • 0.2.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Action Mailer Shoulda Macros (and maybe assertions, too)

While Shoulda does ship with some Action Mailer assertions, it does not ship with standard macros that would help in testing Action Mailer emails. Macros such as:

  • should_have_subject
  • should_have_to_recipient
  • should_have_to_recipients - notice the plurality!
  • should_have_from
  • should_have_reply_to
  • should_match_body
  • should_have_mime_parts - also with counts
  • should_have_mime_content_type
  • should_use_charset
  • should_be_inlined_content
  • should_be_an_attachment - also with a check for filename
  • should_have_filename

Incidentally, those happen to be all the macros supported for now. We fully intend to have macros for everything in Action Mailer, but didn't have a need for any others yet (read: nothing forced us to write them yet). So, if you have a need for some others, please feel MORE THAN FREE to fork, add, and send a pull request so we can add them in.

For documentation, just look at the only file in the lib directory for now. Or, install the gem and the rdoc with it.

Installing & Using

Install as a gem:

sudo gem install thumblemonks-shoulda_action_mailer

And then do this in your test_helper.rb (or whatever you call it for your environment):

require 'shoulda_action_mailer'

Or, just tell Rails about them by doing this in your app's test.rb:

config.gem 'thumblemonks-shoulda_action_mailer', :lib => false, :source => 'http://gems.github.com'

Uh ... where are the tests?

I feel kind of bad not having tests here, but I actually did write these macros as refactorings to tests I already had in a certain other project that shall remain nameless for the time being. So, I don't really feel compelled to add any tests here unless someone asks me or I just decide to modify this code for random reason.

I hope that satisfies you.

Contact

Justin Knowlden gus@gusg.us

License

See LICENSE

FAQs

Package last updated on 02 Oct 2009

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc