Add wait_for_ajax to your helper
def wait_for_ajax
Timeout.timeout(Capybara.default_wait_time) do
loop do
active = page.evaluate_script('jQuery.active')
break if active == 0
end
end
end
In your Capybara test case
click_on "Load more"
wait_for_ajax
expect(page).to have_content "New Product"
thank you very much