Archive for the ‘Technical’ Category

Undefined Method When Testing Rails Plugins With Shoulda

Monday, June 22nd, 2009

This is a quick post to help others who may have this problem in the future, or if I forget how I solved this problem (again).

The problem:

Running rake test in your Ruby on Rails plugin directory results in a method not found error (should_validate_presence_of in my case).

The solution:

  1. Run plugin tests from RAILS_ROOT to properly load environment, include shoulda rails initialization: PLUGIN=url_facade rake test:plugins
  2. Make sure that test_helper.rb includes the following: require ’shoulda’; require ’shoulda/rails’

The solution is pretty easy in the end, but this has tripped me up more than once!

Convert From Subversion To Git

Friday, December 12th, 2008

Fuzzy Searching With Ferret

Saturday, September 20th, 2008