rails 3 rspec-rails 2
in controller
def index @users = User.paginate :page => params[:page],:per_pae => 5 end
in view
User list
<% @users.each do |user|%<%= user.name %>
<% end %> <%= will_paginate @users %>Now I use rspec-rails 2 to test view.
require 'spec_helper'
describe "/users/index.html.erb" do
before(:each) do assign(:users, [ stub_model(User), stub_model(User), stub_model(User, stub_model(User) ]) endit "renders a list of contracts" do render
rendered.should contain "User list" end
end
Now I use rspec common to test it.I got: undefined method `total_pages' for #
How to stub paginate or some other way to fix it?