title: How to test mongoid scopes?
body: <p>I defined the following User class with scopes : </p>
  
  <pre><code>class User
    include Mongoid::Document
    include Mongoid::Timestamps
    include Mongoid::Search
  
    # SCOPES
    scope :all_admins, where( role: :admin)
    scope :recents, order_by(created_at: :desc)
    scope :olders, order_by(created_at: :asc)
  
    field :role, type: Symbol
  end
  </code></pre>
  
  <p>If I use the following rspec test : </p>
  
  <pre><code>describe 'scopes' do
    let(:admin1)            { Fabricate(:admin) }
    let(:admin2)               { Fabricate(:admin) }
  
    describe 'recents' do
      it 'should return the admins from most recent to older' do
        User.all_admins.recents.should eq([admin1, admin2])
      end
    end
  end
  </code></pre>
  
  <p>I get the following fail message : </p>
  
  <pre><code>got: #&lt;Mongoid::Criteria
    selector: {"role"=&gt;:admin},
    options:  {:sort=&gt;{"created_at"=&gt;-1}},
    class:    User,
    embedded: false&gt;
  </code></pre>
  
  <p>So how could I test this scope ?</p>