title: RSpec Catch Validation Error
body: <p>I have a model that validates name and terms acceptance</p>
  
  <pre><code>class Product &lt; ActiveRecord::Base
  
    validates :name, presence: true,
              length: { maximum: 50 }, on: :update
  
    validates_acceptance_of :agreed_to_terms, on: :update
  </code></pre>
  
  <p>I have written a simple test</p>
  
  <pre><code>  it 'redirects back if there is missing info' do
      post "/product/1", {:name =&gt; "john"}
  
      expect(ActiveRecord).to raise_error(StatementInvalid)
    end
  </code></pre>
  
  <p>I can't seem to catch the error.</p>
  
  <pre><code> ActiveRecord::StatementInvalid:
     SQLite3::ConstraintException: NOT NULL constraint failed:
  </code></pre>