Fix hash alignment in specs by putting opening brace on separate line

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

@ -52,10 +52,13 @@ RSpec.describe 'SMS Settings', type: :request do
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: { 'enabled' => true, 'provider' => 'twilio', value: {
'twilio_account_sid' => 'AC123', 'enabled' => true,
'twilio_auth_token' => 'keep_me', 'provider' => 'twilio',
'twilio_from' => '+15551234567' }) 'twilio_account_sid' => 'AC123',
'twilio_auth_token' => 'keep_me',
'twilio_from' => '+15551234567'
})
post settings_sms_path, params: { post settings_sms_path, params: {
encrypted_config: { encrypted_config: {
@ -75,9 +78,12 @@ RSpec.describe 'SMS Settings', type: :request do
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: { 'enabled' => true, 'provider' => 'bulkvs', value: {
'basic_auth_token' => 'keep_me', 'enabled' => true,
'from_number' => '15551234567' }) 'provider' => 'bulkvs',
'basic_auth_token' => 'keep_me',
'from_number' => '15551234567'
})
post settings_sms_path, params: { post settings_sms_path, params: {
encrypted_config: { encrypted_config: {
@ -91,10 +97,13 @@ RSpec.describe 'SMS Settings', type: :request do
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: { 'enabled' => true, 'provider' => 'voipms', value: {
'voipms_api_username' => 'user@example.com', 'enabled' => true,
'voipms_api_password' => 'keep_me', 'provider' => 'voipms',
'voipms_did' => '5551234567' }) 'voipms_api_username' => 'user@example.com',
'voipms_api_password' => 'keep_me',
'voipms_did' => '5551234567'
})
post settings_sms_path, params: { post settings_sms_path, params: {
encrypted_config: { encrypted_config: {
@ -111,11 +120,14 @@ RSpec.describe 'SMS Settings', type: :request do
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: { 'enabled' => true, 'provider' => 'signalwire', value: {
'signalwire_space_url' => 'test.signalwire.com', 'enabled' => true,
'signalwire_project_id' => 'uuid-1234', 'provider' => 'signalwire',
'signalwire_api_token' => 'keep_me', 'signalwire_space_url' => 'test.signalwire.com',
'signalwire_from' => '+15551234567' }) 'signalwire_project_id' => 'uuid-1234',
'signalwire_api_token' => 'keep_me',
'signalwire_from' => '+15551234567'
})
post settings_sms_path, params: { post settings_sms_path, params: {
encrypted_config: { encrypted_config: {

@ -32,10 +32,13 @@ RSpec.describe 'SMS Settings' do
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: { 'enabled' => true, 'provider' => 'twilio', value: {
'twilio_account_sid' => 'AC123', 'enabled' => true,
'twilio_auth_token' => 'token', 'provider' => 'twilio',
'twilio_from' => '+15551234567' }) 'twilio_account_sid' => 'AC123',
'twilio_auth_token' => 'token',
'twilio_from' => '+15551234567'
})
visit settings_sms_path visit settings_sms_path
@ -55,8 +58,12 @@ 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: { 'enabled' => true, 'provider' => 'bulkvs', value: {
'basic_auth_token' => 'tok', 'from_number' => '15551234567' }) 'enabled' => true,
'provider' => 'bulkvs',
'basic_auth_token' => 'tok',
'from_number' => '15551234567'
})
end end
it 'shows the provider section on page load' do it 'shows the provider section on page load' do
@ -78,8 +85,12 @@ RSpec.describe 'SMS Settings' do
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: { 'enabled' => true, 'provider' => 'bulkvs', value: {
'basic_auth_token' => 'tok', 'from_number' => '15551234567' }) 'enabled' => true,
'provider' => 'bulkvs',
'basic_auth_token' => 'tok',
'from_number' => '15551234567'
})
visit settings_sms_path visit settings_sms_path
@ -94,8 +105,12 @@ 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: { 'enabled' => true, 'provider' => 'bulkvs', value: {
'basic_auth_token' => 'tok', 'from_number' => '15551234567' }) 'enabled' => true,
'provider' => 'bulkvs',
'basic_auth_token' => 'tok',
'from_number' => '15551234567'
})
visit settings_sms_path visit settings_sms_path
end end
@ -151,10 +166,13 @@ RSpec.describe 'SMS Settings' do
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: { 'enabled' => true, 'provider' => 'twilio', value: {
'twilio_account_sid' => 'AC123', 'enabled' => true,
'twilio_auth_token' => 'secret_token', 'provider' => 'twilio',
'twilio_from' => '+15551234567' }) 'twilio_account_sid' => 'AC123',
'twilio_auth_token' => 'secret_token',
'twilio_from' => '+15551234567'
})
visit settings_sms_path visit settings_sms_path

Loading…
Cancel
Save