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

@@ -1,8 +1,8 @@
require 'rails_helper'
RSpec.describe 'Twitter::CallbacksController', type: :request do
let(:twitter_client) { instance_double(::Twitty::Facade) }
let(:twitter_response) { instance_double(::Twitty::Response, status: '200', body: { message: 'Valid' }) }
let(:twitter_client) { instance_double(Twitty::Facade) }
let(:twitter_response) { instance_double(Twitty::Response, status: '200', body: { message: 'Valid' }) }
let(:raw_response) { double }
let(:user_object_rsponse) do
OpenStruct.new(
@@ -15,15 +15,15 @@ RSpec.describe 'Twitter::CallbacksController', type: :request do
let(:webhook_service) { double }
before do
allow(::Twitty::Facade).to receive(:new).and_return(twitter_client)
allow(::Redis::Alfred).to receive(:get).and_return(account.id)
allow(::Redis::Alfred).to receive(:delete).and_return('OK')
allow(Twitty::Facade).to receive(:new).and_return(twitter_client)
allow(Redis::Alfred).to receive(:get).and_return(account.id)
allow(Redis::Alfred).to receive(:delete).and_return('OK')
allow(twitter_client).to receive(:access_token).and_return(twitter_response)
allow(twitter_response).to receive(:raw_response).and_return(raw_response)
allow(raw_response).to receive(:body).and_return('oauth_token=1&oauth_token_secret=1&user_id=100&screen_name=chatwoot')
allow(twitter_client).to receive(:user_show).and_return(user_object_rsponse)
allow(JSON).to receive(:parse).and_return(user_object_rsponse)
allow(::Twitter::WebhookSubscribeService).to receive(:new).and_return(webhook_service)
allow(Twitter::WebhookSubscribeService).to receive(:new).and_return(webhook_service)
end
describe 'GET /twitter/callback' do