title: How to fire concurrent requests using RSpec controller spec?
body: <p>I'm trying to fire 5 requests at the same time using threads and RSpec, but that gives me an <code>AbstractController::DoubleRenderError</code> error. I think RSpec is sharing the same "context" for the requests.</p>
  
  <pre><code>context 'when the request is duplicated' do
    it 'blocks duplicate requests' do
      expect{
  
        threads = 5.times.map do
          Thread.new { post :checkout }
        end
        threads.map(&amp;:join)
  
      }.to change{
        PaymentTransaction.count
      }.by(1)
    end
  end
  </code></pre>
  
  <p>Is there any way to test concurrent requests using RSpec controller tests without raising this kind of exception, nor sharing the same "environment"?</p>