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>
<% end %>
<%= 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| %>
<%= 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| %>
<%= f.fields_for :value do |ff| %>
<div class="form-control">
<label class="label cursor-pointer" for="encrypted_config_value_enabled">

@ -51,7 +51,9 @@ RSpec.describe 'SMS Settings', type: :request do
end
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: {
'enabled' => true,
'provider' => 'twilio',
@ -77,7 +79,9 @@ RSpec.describe 'SMS Settings', type: :request do
end
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: {
'enabled' => true,
'provider' => 'bulkvs',
@ -96,7 +100,9 @@ RSpec.describe 'SMS Settings', type: :request do
end
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: {
'enabled' => true,
'provider' => 'voipms',
@ -108,8 +114,11 @@ RSpec.describe 'SMS Settings', type: :request do
post settings_sms_path, params: {
encrypted_config: {
value: {
enabled: '1', provider: 'voipms',
voipms_api_username: 'user@example.com', voipms_api_password: '', voipms_did: '5551234567'
enabled: '1',
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
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: {
'enabled' => true,
'provider' => 'signalwire',
@ -132,9 +143,12 @@ RSpec.describe 'SMS Settings', type: :request do
post settings_sms_path, params: {
encrypted_config: {
value: {
enabled: '1', provider: 'signalwire',
signalwire_space_url: 'test.signalwire.com', signalwire_project_id: 'uuid-1234',
signalwire_api_token: '', signalwire_from: '+15551234567'
enabled: '1',
provider: 'signalwire',
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
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: {
'enabled' => true,
'provider' => 'twilio',
@ -57,7 +59,9 @@ RSpec.describe 'SMS Settings' do
context 'when SMS is enabled' do
before do
create(:encrypted_config, account:, key: EncryptedConfig::SMS_CONFIGS_KEY,
create(:encrypted_config,
account:,
key: EncryptedConfig::SMS_CONFIGS_KEY,
value: {
'enabled' => true,
'provider' => 'bulkvs',
@ -84,7 +88,9 @@ RSpec.describe 'SMS Settings' do
end
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: {
'enabled' => true,
'provider' => 'bulkvs',
@ -104,7 +110,9 @@ RSpec.describe 'SMS Settings' do
describe 'provider switching' do
before do
create(:encrypted_config, account:, key: EncryptedConfig::SMS_CONFIGS_KEY,
create(:encrypted_config,
account:,
key: EncryptedConfig::SMS_CONFIGS_KEY,
value: {
'enabled' => true,
'provider' => 'bulkvs',
@ -165,7 +173,9 @@ RSpec.describe 'SMS Settings' do
end
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: {
'enabled' => true,
'provider' => 'twilio',

Loading…
Cancel
Save