Commit 7e4b7dc
Add comprehensive --rsc-pro generator tests (#3098)
## Summary
- Add missing test assertions for the `--rsc-pro` generator context to
match the thoroughness of the `--rsc` tests
- Verifies node-renderer.js creation, RSC bundle watcher in
Procfile.dev, HelloServer replacing HelloWorld (controller + routes +
components), hello_server and rsc_payload routes, and
rscWebpackConfig.js
The `--rsc-pro` generator mode implementation was completed in #2822,
but the test coverage was incomplete — only version pinning and
DEFAULT_ROUTE were verified. This closes the gap by adding route,
component, Procfile, and webpack config assertions.
Closes #2793
## Test plan
- [x] `bundle exec rspec
react_on_rails/spec/react_on_rails/generators/install_generator_spec.rb
-e "with --rsc-pro"` — 12 examples, 0 failures
- [x] `bundle exec rubocop` — no offenses
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: only adds RSpec assertions around generator output, with no
production code changes. Main risk is increased test brittleness if
templates evolve.
>
> **Overview**
> Strengthens test coverage for the `react_on_rails:install --rsc-pro`
path by asserting generation of `client/node-renderer.js`, the RSC
bundle watcher entry in `Procfile.dev`, and the switch from `HelloWorld`
scaffolding to `HelloServer`.
>
> Adds checks that `config/routes.rb` includes both `hello_server` and
`rsc_payload`, and verifies RSC-specific webpack artifacts
(`config/webpack/rscWebpackConfig.js` plus `RSCWebpackPlugin` usage and
the `rscBundle` parameter in `serverWebpackConfig`).
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1b5b1d1. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Expanded test coverage for installation configuration validation,
including scaffold setup and configuration file generation checks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 0610126 commit 7e4b7dc
1 file changed
Lines changed: 59 additions & 0 deletions
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
1735 | 1794 | | |
1736 | 1795 | | |
1737 | 1796 | | |
| |||
0 commit comments