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
Add unit tests for wrap_console_script_with_nonce method
Adds comprehensive unit tests for the wrap_console_script_with_nonce helper method
to ensure proper CSP nonce handling across different Rails versions.
Test coverage includes:
- CSP nonce attribute generation when available
- Script tag creation without nonce when CSP is not configured
- Rails 5.2-6.0 compatibility fallback (ArgumentError handling)
- Blank input handling (empty, nil, whitespace)
- Multi-line script preservation (newlines maintained)
- Special character escaping in script content
These tests validate the cross-version Rails compatibility logic (5.2-7.x) that is
critical infrastructure code for the CSP nonce support feature.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
0 commit comments