Skip to content

Commit 1684992

Browse files
committed
lint
1 parent 4f275a3 commit 1684992

7 files changed

Lines changed: 19 additions & 19 deletions

File tree

app/jobs/debug_notification_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,4 @@ def send_to_admin(bot, admin, message)
144144
Rails.logger.error "[DebugNotifier] Unexpected error sending to admin #{admin.id}: #{e.message}"
145145
raise
146146
end
147-
end
147+
end

app/services/debug_notifier.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,15 @@ def notify_error(error, context = {}, message = nil)
102102
return unless enabled?
103103

104104
error_type = case error
105-
when Telegram::Bot::Error
105+
when Telegram::Bot::Error
106106
'telegram_api_error'
107-
when ActiveRecord::RecordInvalid
107+
when ActiveRecord::RecordInvalid
108108
'validation_error'
109-
when Timeout::Error
109+
when Timeout::Error
110110
'timeout_error'
111-
else
111+
else
112112
'error'
113-
end
113+
end
114114

115115
error_message = message || "#{error.class}: #{error.message}"
116116
notify(error_type, error_message, context.merge(
@@ -132,4 +132,4 @@ def admin_count
132132
TelegramUser.where(is_admin: true).count
133133
end
134134
end
135-
end
135+
end

test/controllers/telegram_debug_command_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,4 @@ def extract_message_content(requests)
265265
assert_not_nil message_content
266266
assert_not_includes message_content[:text], '/debug — включить/выключить режим отладки'
267267
end
268-
end
268+
end

test/integration/debug_functionality_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,4 @@ def self.test_method
248248
assert_not_nil regular_help_content
249249
assert_not_includes regular_help_content[:text], '/debug — включить/выключить режим отладки'
250250
end
251-
end
251+
end

test/jobs/debug_notification_job_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def teardown
3737

3838
# Basic job execution tests
3939
test 'should enqueue job with correct parameters' do
40-
assert_enqueued_with(job: DebugNotificationJob, args: ['error', 'Test message', { user_id: 123 }]) do
40+
assert_enqueued_with(job: DebugNotificationJob, args: [ 'error', 'Test message', { user_id: 123 } ]) do
4141
DebugNotificationJob.perform_later('error', 'Test message', { user_id: 123 })
4242
end
4343
end
@@ -49,7 +49,7 @@ def teardown
4949
end
5050

5151
test 'should enqueue job for different message types' do
52-
message_types = ['error', 'warning', 'info', 'success', 'channel_update_error', 'message_processing_error', 'system_alert']
52+
message_types = [ 'error', 'warning', 'info', 'success', 'channel_update_error', 'message_processing_error', 'system_alert' ]
5353

5454
message_types.each do |type|
5555
assert_enqueued_jobs 1 do
@@ -91,7 +91,7 @@ def teardown
9191
complex_context = {
9292
string: 'test',
9393
number: 42,
94-
array: [1, 2, 3],
94+
array: [ 1, 2, 3 ],
9595
hash: { nested: 'value', deep: { value: 123 } },
9696
boolean: true,
9797
nil_value: nil,
@@ -159,4 +159,4 @@ def teardown
159159
DebugNotificationJob.perform_later('info', 'Test with special characters', special_context)
160160
end
161161
end
162-
end
162+
end

test/models/system_setting_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,23 +166,23 @@ class SystemSettingTest < ActiveSupport::TestCase
166166
end
167167

168168
test 'should store hash values' do
169-
hash_value = { nested: { value: 42 }, array: [1, 2, 3] }
169+
hash_value = { nested: { value: 42 }, array: [ 1, 2, 3 ] }
170170
setting = SystemSetting.create!(key: 'config', value: hash_value)
171171
setting.reload
172172

173173
# JSONB converts symbol keys to strings
174-
expected_value = { 'nested' => { 'value' => 42 }, 'array' => [1, 2, 3] }
174+
expected_value = { 'nested' => { 'value' => 42 }, 'array' => [ 1, 2, 3 ] }
175175
assert_equal expected_value, setting.value
176176
assert_equal expected_value, SystemSetting.get('config')
177177
end
178178

179179
test 'should store array values' do
180-
array_value = ['item1', 'item2', { nested: 'value' }]
180+
array_value = [ 'item1', 'item2', { nested: 'value' } ]
181181
setting = SystemSetting.create!(key: 'list', value: array_value)
182182
setting.reload
183183

184184
# JSONB converts symbol keys to strings in nested objects
185-
expected_value = ['item1', 'item2', { 'nested' => 'value' }]
185+
expected_value = [ 'item1', 'item2', { 'nested' => 'value' } ]
186186
assert_equal expected_value, setting.value
187187
assert_equal expected_value, SystemSetting.get('list')
188188
end

test/services/debug_notifier_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def teardown
322322
context = {
323323
string: 'test string',
324324
number: 42,
325-
array: [1, 2, 3],
325+
array: [ 1, 2, 3 ],
326326
hash: { nested: 'value' },
327327
boolean: true,
328328
nil_value: nil
@@ -332,4 +332,4 @@ def teardown
332332
DebugNotifier.notify('info', 'Test with complex context', context)
333333
end
334334
end
335-
end
335+
end

0 commit comments

Comments
 (0)