title: How to test parameterized scope method using rspec(v3.4.1) in rails(v4.2.5)?
body: <p>Model:  </p>
  
  <blockquote>
  <pre><code> scope :recent, -&gt;(n) {where(:created_at =&gt; 6.months.ago..Time.now).order('created_at DESC').limit(n)}  
  </code></pre>
  </blockquote>
  
  <p>I would do something like this in Rspec:    </p>
  
  <blockquote>
  <pre><code>before(:each) do  
    @song = double(Song,id: 1, name: "Vegan artisan.", album_id: 1, artist_id: 20, created_at: "2016-03-04 13:15:36", updated_at: "2016-03-04 13:15:36")  
  end              
  it "should return the recent most songs within range" do   
    Song.stub_chain(:where,:order,:limit).with(created_at:6.months.ago..Time.now).with('created_at DESC').with(2).and_return([@song,@song])  
    Song.recent.should == [@song,@song]  
  end  
  </code></pre>
  </blockquote>
  
  <p>The above case is failing , giving the below mentioned error:</p>
  
  <blockquote>
  <pre><code> ArgumentError:
     wrong number of arguments (0 for 1)
  </code></pre>
  </blockquote>
  
  <p>I tried different approaches, but still hard luck. Any help on this would   be appreciated. Thanks in advance!!</p>