New to shoulda and can't figure out why this fails`

1 view
Skip to first unread message

MCMoyer

unread,
Jun 25, 2009, 12:51:44 PM6/25/09
to shoulda
I've got a simple test using the macro
"should_validate_presence_of :name". It seems like the test should
pass, but it gives me the following feedback.


test: Project should require name to be set. (ProjectTest) [/home/
mmoyer/.gem/ruby/1.9.1/gems/thoughtbot-shoulda-2.10.1/lib/shoulda/
active_record/macros.rb:46]:
errors to include ["name can't be blank"] when name is set to nil, got
errors: ["name can't be blank (nil)"].
block to return true value.

Nick Quaranto

unread,
Jun 25, 2009, 12:58:06 PM6/25/09
to sho...@googlegroups.com
I believe this is a Ruby 1.9 issue, and the current version of Shoulda isn't 1.9 compatible. There's a branch on GitHub that you can check out and use.

http://github.com/thoughtbot/shoulda/tree/ruby19

I also uploaded that version to Gemcutter for testing during the last Boston.rb hackfest, so if you want to install it:

sudo gem install shoulda -s http://gemcutter.org

This 1.9 build from Gemcutter is by no means official, but it definitely is passing all of its tests on 1.9. Try it and let us know if it helps out.
Reply all
Reply to author
Forward
0 new messages