Currently, I’m a newbie to using rails 7 with turbo. I’m stuck with a problem the button “load more” works on the browser however when run on test capybara it only returns the white page with text. Should I need to configure it in RSpec or rails_helper?
= turbo_frame_tag 'favorite_users' do
= link_to 'Load more', local_assigns[:url_pagination], class: 'inline-block mx-auto w-full
When run on development, I debug to check
But when run on test, the
The screenshot failure:
- Ruby: 3.1.0
- Rails: 22.214.171.124
Try putting this code in your
class ApplicationController < ActionController::Base
helper Turbo::FramesHelper if Rails.env.test?
helper Turbo::StreamsHelper if Rails.env.test?
@rockwell Are you sure about
require "hotwire-rails"? It looks deprecated.
Currently, I’m using gem
stimulus-rails & turbo-rails. I’ve tried with your code without
require "hotwire-rails" but it’s same
Well. That code hasn’t been touched since a long time. But, i remember i also had the same issue you’re facing.
And, including the
StreamsHelper solved it for me. I’m sorry it didn’t work for you
@rockwell No problem. It makes me try another solution. Currently, I’m putting the button inside a form and it works in capybara. Thank you for your solution