RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Rails Tip: Raise Mass-Assignment Errors in Tests

Since I’ve started using attr_accessible for security reasons, I’ve been bitten a few times while in development. The problem is that attempts to mass-assign protected attributes fail silently, save for a note in the debug log. Here’s a quick tip that explains how to raise these failed assignments as exceptions when testing your application.

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