I have a table that is populated using AJAX pagination (Kaminari). What I’m trying to do is view this page and make sure there is certain content within the table. This causes a problem with my Capybara test because it doesn’t wait for the pagination to finish before it checks the page for the content. I’m thinking it’s something simple that I’m overlooking, but I have been unable to find a solution through google. I suppose I could just wait for a given amount of time, but this solution seems hacky to me.
Here is my test:
visit accounts_path
#This is the text that should be inside the paginated table
page.should have_content('test.test@mail.com')