Skip to content

Commit 0463bde

Browse files
Stefanni BrasilK4sku
Stefanni Brasil
andauthored
Document Testing configuration for RSpec users (#539)
* Document testing configuration for RSpec users Jbuilder documentation does not guide users to any extra configuration to test the response body of a template. Searching for "Rspec" in the project, we see that there are lots of closed issues related to this issue. Although this extra configuration is not related to JBuilder, I believe this is an important thing to have in the documentation. Including a note about it in the documentation would save users hours of trying to debug JBuilder, and maintainer's hours that could be used on another features. * Update README.md * Link docs to rspec official docs instead of relish app Co-authored-by: Cezary Kłos <[email protected]> --------- Co-authored-by: Cezary Kłos <[email protected]>
1 parent 6732db4 commit 0463bde

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,10 @@ environment.rb for example):
338338
Jbuilder.deep_format_keys true
339339
```
340340

341+
## Testing JBuilder Response body with RSpec
342+
343+
To test the response body of your controller spec, enable `render_views` in your RSpec context. This [configuration](https://rspec.info/features/6-0/rspec-rails/controller-specs/render-views) renders the views in a controller test.
344+
341345
## Contributing to Jbuilder
342346

343347
Jbuilder is the work of many contributors. You're encouraged to submit pull requests, propose

0 commit comments

Comments
 (0)