chore: Enable the new Rubocop rules (#7122)

fixes: https://linear.app/chatwoot/issue/CW-1574/renable-the-disabled-rubocop-rules
This commit is contained in:
Sojan Jose
2023-05-19 14:37:10 +05:30
committed by GitHub
parent b988a01df3
commit 7ab7bac6bf
215 changed files with 609 additions and 608 deletions

View File

@@ -328,15 +328,15 @@ describe Whatsapp::IncomingMessageService do
expect(Message.find_by(source_id: 'wamid.SDFADSf23sfasdafasdfa')).not_to be_present
key = format(Redis::RedisKeys::MESSAGE_SOURCE_KEY, id: 'wamid.SDFADSf23sfasdafasdfa')
::Redis::Alfred.setex(key, true)
expect(::Redis::Alfred.get(key)).to be_truthy
Redis::Alfred.setex(key, true)
expect(Redis::Alfred.get(key)).to be_truthy
described_class.new(inbox: whatsapp_channel.inbox, params: params).perform
expect(whatsapp_channel.inbox.messages.count).to eq(0)
expect(Message.find_by(source_id: 'wamid.SDFADSf23sfasdafasdfa')).not_to be_present
expect(::Redis::Alfred.get(key)).to be_truthy
::Redis::Alfred.delete(key)
expect(Redis::Alfred.get(key)).to be_truthy
Redis::Alfred.delete(key)
end
end
end

View File

@@ -30,7 +30,7 @@ describe Whatsapp::Providers::WhatsappCloudService do
it 'calls message endpoints for image attachment message messages' do
attachment = message.attachments.new(account_id: message.account_id, file_type: :image)
attachment.file.attach(io: File.open(Rails.root.join('spec/assets/avatar.png')), filename: 'avatar.png', content_type: 'image/png')
attachment.file.attach(io: Rails.root.join('spec/assets/avatar.png').open, filename: 'avatar.png', content_type: 'image/png')
stub_request(:post, 'https://graph.facebook.com/v13.0/123456789/messages')
.with(
@@ -47,7 +47,7 @@ describe Whatsapp::Providers::WhatsappCloudService do
it 'calls message endpoints for document attachment message messages' do
attachment = message.attachments.new(account_id: message.account_id, file_type: :file)
attachment.file.attach(io: File.open(Rails.root.join('spec/assets/sample.pdf')), filename: 'sample.pdf', content_type: 'application/pdf')
attachment.file.attach(io: Rails.root.join('spec/assets/sample.pdf').open, filename: 'sample.pdf', content_type: 'application/pdf')
# ref: https://github.com/bblimke/webmock/issues/900
# reason for Webmock::API.hash_including