title: How to make Rspec save_and_open_page automatically when any spec fails
body: <p>I have...</p>
  
  <p><strong>/spec/spec_helper.rb</strong>:</p>
  
  <pre><code>require 'capybara/rspec'
  require 'capybara/rails'
  require 'capybara/dsl'
  
  RSpec.configure do |config|
    config.fail_fast = true
    config.use_instantiated_fixtures = false 
    config.include(Capybara, :type =&gt; :integration)
  end
  </code></pre>
  
  <p>So as soon as any spec fails, Rspec quits and shows you the error.</p>
  
  <p>At the point, I'd like Rspec to also automatically call Capybara's <code>save_and_open_page</code> method. How can I do this?</p>
  
  <p><a href="https://github.com/mattheworiordan/capybara-screenshot" rel="noreferrer">Capybara-Screenshot</a> looks promising, but while it saves both the HTML and a screenshot as an image file (which I don't need), it does not automatically open them.</p>