mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-29 18:22:53 +00:00
fix: response body in twitter callback (#6907)
* fix: response body * fix: tests
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user