title: RSpec & Tire gem: test for Tire::Results::Collection
body: <p>Trying understand syntax for testing around the Tire gem.</p>
  
  <p>This controller spec (default from a scaffold template) is failing</p>
  
  <pre><code>  describe "GET index" do
      it "assigns all reports as @reports" do
        report = Report.create! valid_attributes
        get :index, {}, valid_session
        assigns(:reports).should eq([report])
      end
    end
  </code></pre>
  
  <p>because</p>
  
  <pre><code> Failure/Error: assigns(:reports).should eq([report])
   TypeError:
     can't convert Tire::Results::Collection to Array (Tire::Results::Collection#to_ary gives Tire::Results::Collection)
  </code></pre>
  
  <p>How to write the spec so that it expects a Tire <strong>result</strong> collection instead of an array of active record objects? Or, is there a better way to go about this? </p>
  
  <p>FWIW-</p>
  
  <pre><code>class ReportsController &lt; ApplicationController  
    def index
      @reports = Report.search(params)
    end
  
    ...
  </code></pre>
  
  <p>and the model:</p>
  
  <pre><code>class Report &lt; ActiveRecord::Base
    include Tire::Model::Search
    include Tire::Model::Callbacks
    ...
    def self.search(params)
      tire.search(load: true) do
        query { string params[:query] } if params[:query].present?
      end
    end
    ...
  </code></pre>