title: expected: 1 time with any arguments received: 0 times with any argument
body: <p>I'm testing the <code>index</code> action for my <code>ProjectsController</code>.</p>
  
  <p>I'm using the will_paginate gem, and am trying to write an RSpec test that ensures the paginate method is called on the current user's projects when they projects_path.</p>
  
  <p>The result I'm getting, however, isn't what I expected and I can't figure out why. </p>
  
  <p><strong>result</strong></p>
  
  <pre><code>Failure/Error: expect(user.projects).to receive(:paginate)
         (#&lt;ActiveRecord::Associations::CollectionProxy::ActiveRecord_Associations_CollectionProxy_Project:0x00000004719ef0&gt;).paginate(any args)
             expected: 1 time with any arguments
             received: 0 times with any arguments
       # ./spec/requests/project_pages_spec.rb:82:in `block (3 levels) in &lt;top (required)&gt;'
  </code></pre>
  
  <p><strong>projects#index</strong></p>
  
  <pre><code>def index
      if params[:search]
        @projects = current_user.projects.search(params[:search]).paginate(:page =&gt; params[:page], :per_page =&gt; 13)
      else
        @projects = current_user.projects.paginate(:page =&gt; params[:page], :per_page =&gt; 13)
      end 
  end 
  </code></pre>
  
  <p><strong>index test</strong></p>
  
  <pre><code>describe "index" do
  
    describe "pagination" do
  
      let(:user) { FactoryGirl.create(:user) }
      let(:client) { FactoryGirl.create(:client) }
  
      before do
        capybara_sign_in(user)
        @project = Project.create(name: "Blog", fee: 550, client_id: client.id)
      end 
  
      it "should call the paginate method" do
        expect(user.projects).to receive(:paginate)
        visit projects_path
      end
    end
  end
  </code></pre>
  
  <p>Note that I haven't finished writing the tests, so please omit any comments re: drying up the code etc. </p>
  
  <p>Thanks for the help guys/gals! :)</p>