fix: response body in twitter callback (#6907)

* fix: response body

* fix: tests
This commit is contained in:
Shivam Mishra
2023-04-14 16:48:28 +05:30
committed by GitHub
parent 4d49b81f1c
commit 1886d4ce08
2 changed files with 2 additions and 2 deletions

View File

@@ -62,7 +62,7 @@ class Twitter::CallbacksController < Twitter::BaseController
return unless response.status.to_i == 200
parsed_user_profile = JSON.parse(response.read_body)
parsed_user_profile = response.body
::Avatar::AvatarFromUrlJob.perform_later(inbox, parsed_user_profile['profile_image_url_https'])
end

View File

@@ -6,7 +6,7 @@ RSpec.describe 'Twitter::CallbacksController', type: :request do
let(:raw_response) { double }
let(:user_object_rsponse) do
OpenStruct.new(
read_body: '{"profile_background_color":"000000","profile_background_image_url":"http:\\/\\/abs.twimg.com\\/images\\/themes\\/theme1\\/bg.png"}',
body: '{"profile_background_color":"000000","profile_background_image_url":"http:\\/\\/abs.twimg.com\\/images\\/themes\\/theme1\\/bg.png"}',
status: 200,
success?: true
)