RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

Introducing Whiny Validation. So You Can Figure Out Why Your Rails Specs Failed.

Sometimes when you run a spec in a Rails app, it fails silently but it isn’t clear why. Frequently, this type of spec failure is due to an input validation error. But the log won’t tell you that. That’s why I created the Whiny Validation gem. Whiny Validation watches for ActiveRecord validation errors on all models. Whenever one occurs, it logs the validation message and dumps the ActiveRecord object (with inspect) to the log. A quick look at the log tells you why the spec failed.

Comments

Post a Comment

Comment abilities for non registered users are currently deactivated, pending time to add a proper CAPTCHA to solve the escalating spam problem. Sorry!