It seems I have some kind of conflict between the capybara page method and the Kaminari page method.
What I guessed, anyway, here is the error:
Failure/Error: before { sign_in_as user } ActionView::Template::Error: wrong number of arguments (1 for 0)
Code example:
class Feed def microposts(opts = { urgent: false }) urgent = opts[:urgent] p Microposts.where(id: 1).page # <Capybara::Session> p Microposts.where(id: 1).page(1) # Error end end
If I remove the pagination, the test works fine.
I donβt understand how this is possible, I think Capybara is adding the "page" method to the Object area, but since Kaminari is adding its page method to ActiveRecord :: Base (if I remember correctly), it should override Capybara.
I have not seen anyone have such problems, how is this possible?
Thanks.
source share