I’ on Micheal Hartl tutorial chapter 9 .And i’m trying to check for if the users name are displayed on the page . but i’m getting this error
Failure/Error: User.paginate.(page:1).each do |user|
ArgumentError:
wrong number of arguments (0 for 1)
i probably got to change this part User.paginate.(page: 1).each do |user|. but what do i have to do ?.
here the code inside the rspect directory.
describe "index" do
let(:user) { FactoryGirl.create(:user) }
before do
sign_in user
30.times { FactoryGirl.create(:user) }
visit users_path
end
it { should have_selector('title', text: 'All users') }
it { should have_selector('h1', text: 'All users') }
it "should list each user" do
User.paginate.(page: 1).each do |user|
page.should have_selector('li>a', text: user.name )
end
end
end
you have an extra period after paginate. It should be: