From 921f0c6d4ba54c90b5458a418596c3a592da2cf0 Mon Sep 17 00:00:00 2001 From: Wabo Date: Wed, 3 Jun 2026 17:59:03 -0400 Subject: [PATCH] Fix SMS settings JS: add CSP nonce to inline script, update tests for toggle-hidden behavior The inline script lacked a nonce and was blocked by the enforced CSP (application_controller#set_csp uses a nonce'd script-src), so the toggle and provider-switching handlers never ran. Add the standard content_security_policy_nonce attribute, matching other inline scripts (e.g. scripts/_autosize_field). Update the two original tests that assumed the provider section is always visible, since it is now correctly hidden when SMS is disabled. --- app/views/sms_settings/index.html.erb | 2 +- spec/system/sms_settings_spec.rb | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/views/sms_settings/index.html.erb b/app/views/sms_settings/index.html.erb index 806d700d..0913f91e 100644 --- a/app/views/sms_settings/index.html.erb +++ b/app/views/sms_settings/index.html.erb @@ -198,7 +198,7 @@
-