Fix hash alignment: use trailing-comma multi-line create() style

pull/687/head
Wabo 2 weeks ago
parent c9d15a20fb
commit d4c7a22fa2

@ -0,0 +1 @@
{"sessionId":"788534d2-0579-4528-9721-f9732c3e656c","pid":3625167,"procStart":"96915899","acquiredAt":1780520612812}

@ -60,9 +60,7 @@
</div> </div>
<% end %> <% end %>
<%= form_for @encrypted_config, url: settings_sms_path, method: :post, <%= form_for @encrypted_config, url: settings_sms_path, method: :post, html: { autocomplete: 'off', class: 'space-y-4', id: 'sms_settings_form', data: { turbo_frame: '_top' } } do |f| %>
html: { autocomplete: 'off', class: 'space-y-4', id: 'sms_settings_form' },
data: { turbo_frame: :_top } do |f| %>
<%= f.fields_for :value do |ff| %> <%= f.fields_for :value do |ff| %>
<div class="form-control"> <div class="form-control">
<label class="label cursor-pointer" for="encrypted_config_value_enabled"> <label class="label cursor-pointer" for="encrypted_config_value_enabled">

@ -51,7 +51,9 @@ RSpec.describe 'SMS Settings', type: :request do
end end
it 'preserves existing Twilio auth token when blank is submitted' do it 'preserves existing Twilio auth token when blank is submitted' do
create(:encrypted_config, account:, key: EncryptedConfig::SMS_CONFIGS_KEY, create(:encrypted_config,
account:,
key: EncryptedConfig::SMS_CONFIGS_KEY,
value: { value: {
'enabled' => true, 'enabled' => true,
'provider' => 'twilio', 'provider' => 'twilio',
@ -77,7 +79,9 @@ RSpec.describe 'SMS Settings', type: :request do
end end
it 'preserves existing BulkVS basic_auth_token when blank is submitted' do it 'preserves existing BulkVS basic_auth_token when blank is submitted' do
create(:encrypted_config, account:, key: EncryptedConfig::SMS_CONFIGS_KEY, create(:encrypted_config,
account:,
key: EncryptedConfig::SMS_CONFIGS_KEY,
value: { value: {
'enabled' => true, 'enabled' => true,
'provider' => 'bulkvs', 'provider' => 'bulkvs',
@ -96,7 +100,9 @@ RSpec.describe 'SMS Settings', type: :request do
end end
it 'preserves existing VoIP.ms API password when blank is submitted' do it 'preserves existing VoIP.ms API password when blank is submitted' do
create(:encrypted_config, account:, key: EncryptedConfig::SMS_CONFIGS_KEY, create(:encrypted_config,
account:,
key: EncryptedConfig::SMS_CONFIGS_KEY,
value: { value: {
'enabled' => true, 'enabled' => true,
'provider' => 'voipms', 'provider' => 'voipms',
@ -108,8 +114,11 @@ RSpec.describe 'SMS Settings', type: :request do
post settings_sms_path, params: { post settings_sms_path, params: {
encrypted_config: { encrypted_config: {
value: { value: {
enabled: '1', provider: 'voipms', enabled: '1',
voipms_api_username: 'user@example.com', voipms_api_password: '', voipms_did: '5551234567' provider: 'voipms',
voipms_api_username: 'user@example.com',
voipms_api_password: '',
voipms_did: '5551234567'
} }
} }
} }
@ -119,7 +128,9 @@ RSpec.describe 'SMS Settings', type: :request do
end end
it 'preserves existing SignalWire API token when blank is submitted' do it 'preserves existing SignalWire API token when blank is submitted' do
create(:encrypted_config, account:, key: EncryptedConfig::SMS_CONFIGS_KEY, create(:encrypted_config,
account:,
key: EncryptedConfig::SMS_CONFIGS_KEY,
value: { value: {
'enabled' => true, 'enabled' => true,
'provider' => 'signalwire', 'provider' => 'signalwire',
@ -132,9 +143,12 @@ RSpec.describe 'SMS Settings', type: :request do
post settings_sms_path, params: { post settings_sms_path, params: {
encrypted_config: { encrypted_config: {
value: { value: {
enabled: '1', provider: 'signalwire', enabled: '1',
signalwire_space_url: 'test.signalwire.com', signalwire_project_id: 'uuid-1234', provider: 'signalwire',
signalwire_api_token: '', signalwire_from: '+15551234567' signalwire_space_url: 'test.signalwire.com',
signalwire_project_id: 'uuid-1234',
signalwire_api_token: '',
signalwire_from: '+15551234567'
} }
} }
} }

@ -31,7 +31,9 @@ RSpec.describe 'SMS Settings' do
end end
it 'shows the test SMS section when SMS is configured and enabled' do it 'shows the test SMS section when SMS is configured and enabled' do
create(:encrypted_config, account:, key: EncryptedConfig::SMS_CONFIGS_KEY, create(:encrypted_config,
account:,
key: EncryptedConfig::SMS_CONFIGS_KEY,
value: { value: {
'enabled' => true, 'enabled' => true,
'provider' => 'twilio', 'provider' => 'twilio',
@ -57,7 +59,9 @@ RSpec.describe 'SMS Settings' do
context 'when SMS is enabled' do context 'when SMS is enabled' do
before do before do
create(:encrypted_config, account:, key: EncryptedConfig::SMS_CONFIGS_KEY, create(:encrypted_config,
account:,
key: EncryptedConfig::SMS_CONFIGS_KEY,
value: { value: {
'enabled' => true, 'enabled' => true,
'provider' => 'bulkvs', 'provider' => 'bulkvs',
@ -84,7 +88,9 @@ RSpec.describe 'SMS Settings' do
end end
it 'hides the provider section when the toggle is turned off' do it 'hides the provider section when the toggle is turned off' do
create(:encrypted_config, account:, key: EncryptedConfig::SMS_CONFIGS_KEY, create(:encrypted_config,
account:,
key: EncryptedConfig::SMS_CONFIGS_KEY,
value: { value: {
'enabled' => true, 'enabled' => true,
'provider' => 'bulkvs', 'provider' => 'bulkvs',
@ -104,7 +110,9 @@ RSpec.describe 'SMS Settings' do
describe 'provider switching' do describe 'provider switching' do
before do before do
create(:encrypted_config, account:, key: EncryptedConfig::SMS_CONFIGS_KEY, create(:encrypted_config,
account:,
key: EncryptedConfig::SMS_CONFIGS_KEY,
value: { value: {
'enabled' => true, 'enabled' => true,
'provider' => 'bulkvs', 'provider' => 'bulkvs',
@ -165,7 +173,9 @@ RSpec.describe 'SMS Settings' do
end end
it 'retains existing Twilio auth token when left blank on re-save' do it 'retains existing Twilio auth token when left blank on re-save' do
create(:encrypted_config, account:, key: EncryptedConfig::SMS_CONFIGS_KEY, create(:encrypted_config,
account:,
key: EncryptedConfig::SMS_CONFIGS_KEY,
value: { value: {
'enabled' => true, 'enabled' => true,
'provider' => 'twilio', 'provider' => 'twilio',

Loading…
Cancel
Save