RubyFlow The Ruby and Rails community linklog

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.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in