Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Update: Add a section for how to add the render_inline helpers to RSpec tests #2162

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ nav_order: 5

## main

* Updates testing docs to include an example of how to use with RSpec.

*Rylan Bowers*

* Add `--skip-suffix` option to component generator.

*KAWAKAMI Moeki*
Expand Down
15 changes: 15 additions & 0 deletions docs/guide/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ _Note: `assert_selector` only matches on visible elements by default. To match o

For debugging purposes, the `rendered_content` test helper outputs the rendered HTML.

## Use with RSpec

To enable ViewComponent test helpers in RSpec, add:

```ruby
# spec/rails_helper.rb
require "view_component/test_helpers"

RSpec.configure do |config|
# ...

config.include ViewComponent::TestHelpers, type: :component
end
```

## Testing Slots

```ruby
Expand Down
Loading