title: Rspec expect method to receive ActiveRecord::Relation
body: <p>I have a method </p>
  
  <p><code>foo(bars)</code></p>
  
  <p><code>bars</code> is an <code>ActiveRecord::Relation</code></p>
  
  <p>In my spec I want to assert that <code>foo</code> is called with <code>bars</code> but in the spec <code>bars</code> is just an array</p>
  
  <pre><code>let(:bar) { create(:bar) }
  let(:bars) { [bar] }
  
  expect(described_class).to receive(:foo).with(bars)
  </code></pre>
  
  <p>Is there any way to achieve this? I can't stub <code>bars</code> within the controller as I am testing the filtering of <code>bars</code> based on <code>params</code> passed.</p>