Shoulda Doesn’t like ‘Status’

July 25th, 2008 No Comments

One of the models in a project I am working on right now ends in ’status’. Rails handles that just find but in my tests I started noticing an odd error:

test: Lookup should belong_to lookup_status. (LookupTest):
NameError: uninitialized constant LookupStatu

The Shoulda test looks like this:

should_belong_to :lookup_status

Nothing to complicated there. Should recognizes [...]

Tags:   · ·

Shoulda, assert_sent_email and Unreal Users

July 24th, 2008 No Comments

I have been banging my head against a problem in my testing. Using the UI everything worked as expected, but my tests were failing when I tried to see if emails were being sent in a specific case.
Here’s the test I was trying to run using Shoulda:

context “reset password for user that has not [...]

Tags:   · ·

Tip for Testing Email with Ruby on Rails and Shoulda

July 24th, 2008 No Comments

Shoulda comes with a great method for testing email called ‘assert_sent_email’. (If you try it and get a method missing error update Shoulda. Not that anyone wouldn’t know to just do that). No matter what you use to test email as long as you are in test mode your emails will be [...]

Tags:   · · ·