Skip to content
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