Documentation Update: Add a section for how to add the render_inline helpers to RSpec tests #2162
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
While getting started w/ View Component today, I struggled w/ errors like 'Undefined method
render_inline
for ...What approach did you choose and why?
I updated the documentation to include a section referencing https://stackoverflow.com/questions/70041733/integrating-viewcomponent-with-rspec and how to add the view component test helpers
I believe that the comment above this section that mentions
(Capybara matchers are available if the gem is installed)
would indicate that addingrequire "capybara/rspec"
orconfig.include Capybara::RSpecMatchers, type: :component
is not a requirement to use those matchers. There may be some nuance that I don't fully understand to different setups though!Welcome to any feedback
Anything you want to highlight for special attention from reviewers?
I'm happy to update for how to do this for minitest in test_helpers.rb, but I'm unsure if the sytnax is similar or not?