There is a Gem you can add to help you with reflex testing stimulus_reflex_testing
:
https://github.com/podia/stimulus_reflex_testing
Then you will be able to have test such as this:
# app/reflexes/post_reflex.rb
class PostReflex < ApplicationReflex
def find_post
@post = Post.find(params[:id])
end
end
reflex = build_reflex(method_name: :find_post, url: edit_post_url(post), params: { id: post.id })
reflex.run
reflex.get(:post) #=> returns the @post instance variable
The gem also includes some spec matchers. But people in the SR community mostly use system tests.