public
Description: Some testing macros for the Shoulda plugin/gem.
Homepage: http://soyunperdedor.com/
Clone URL: git://github.com/mileszs/shoulda_macros.git
shoulda_macros / README.textile
100644 23 lines (13 sloc) 1.291 kb

Shoulda Macros

Included here are macros for the testing sugar that is Shoulda. There are tests for the following plugins:

  • ActsAsFerret – should_act_as_ferret
  • Paperclip (lifted from Thoughtbot) – should_act_as_paperclip
  • ActsAsTaggableOnSteroids – should_act_as_taggable_on_steroids
  • ActsAsList – should_act_as_list

There is also a macro that I stole from the Thoughtbot project Clearance called should_have_form, that is a bit more full-featured than Shoulda’s should_render_a_form. I’m assuming it will eventually make it into Shoulda.

Place these files in RAILS_ROOT/test/shoulda_macros, and they will be automatically required when running tests. For some usage examples, see http://soyunperdedor.com/node/34.

I will continue to add macros as I accumulate them.

Shoulda Plugin Macros elswhere

If you are in need of more plugin-related Shoulda macros, you should look into Woulda.

Woulda: http://github.com/seanhussey/woulda/tree/master

The plugin macros you see here are included in the Woulda gem, along with macros for acts_as_paranoid, attachment_fu, enumeration_mixin, will_paginate, and acts_as_solr (as of October 3rd, 2008).