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