Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Custom Shoulda macros for quick and easy testing
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
shoulda_macros
README.rdoc

README.rdoc

Shoulda Testing Macros

A set of my own shoulda macros to make testing easier

Installation

git submodule add git://github.com/mendable/test-macros.git vendor/plugins/test-macros
git commit -am "add mendable test-macros"

Ensure that you have this in your config/deploy.rb:

set :git_enable_submodules, true

so that the submodules are pulled down when you deploy your application.

The Macros

should_have_default_value

should_have_default_value :field, "some default value"

This verifies that when a new model instance is instantiated, the field specified is created with the default value given.

should_have_thinking_sphinx_index

should_have_thinking_sphinx_index :name, :field1, :field2, :fieldN

Verifies that thinking sphinx defines an index on the model and indexes the list of given fields.

Patches

If you branch and enhance this product in anyway, please do contact me to let me know, either on GitHub (www.github.com/mendable) or through my website (www.mendable.com).

Licence

Copyright © 2009 Jason Lambert (www.mendable.com).

Code released under the MIT license.

Something went wrong with that request. Please try again.