You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]>
Copy file name to clipboardexpand all lines: README.md
+4
Original file line number
Diff line number
Diff line change
@@ -338,6 +338,10 @@ environment.rb for example):
338
338
Jbuilder.deep_format_keys true
339
339
```
340
340
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
+
341
345
## Contributing to Jbuilder
342
346
343
347
Jbuilder is the work of many contributors. You're encouraged to submit pull requests, propose
0 commit comments