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

@@ -53,7 +53,7 @@ RSpec.describe Channel::Telegram do
it 'send image' do
telegram_attachment_response = double
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')
allow(telegram_attachment_response).to receive(:success?).and_return(true)
allow(telegram_attachment_response).to receive(:parsed_response).and_return({ 'result' => [{ 'message_id' => 'telegram_456' }] })
@@ -64,7 +64,7 @@ RSpec.describe Channel::Telegram do
it 'send document' do
telegram_attachment_response = double
attachment = message.attachments.new(account_id: message.account_id, file_type: :file)
attachment.file.attach(io: File.open(Rails.root.join('spec/assets/attachment.pdf')), filename: 'attachment.pdf',
attachment.file.attach(io: Rails.root.join('spec/assets/attachment.pdf').open, filename: 'attachment.pdf',
content_type: 'application/pdf')
allow(telegram_attachment_response).to receive(:success?).and_return(true)
@@ -82,7 +82,7 @@ RSpec.describe Channel::Telegram do
telegram_message_response = double
telegram_attachment_response = double
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')
allow(telegram_message_response).to receive(:success?).and_return(true)
allow(telegram_message_response).to receive(:parsed_response).and_return({ 'result' => { 'message_id' => 'telegram_456' } })

View File

@@ -60,7 +60,7 @@ RSpec.describe Channel::TwilioSms do
let(:twilio_messages) { double }
before do
allow(::Twilio::REST::Client).to receive(:new).and_return(twilio_client)
allow(Twilio::REST::Client).to receive(:new).and_return(twilio_client)
allow(twilio_client).to receive(:messages).and_return(twilio_messages)
end