mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 20:18:08 +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
|
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'])
|
::Avatar::AvatarFromUrlJob.perform_later(inbox, parsed_user_profile['profile_image_url_https'])
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ RSpec.describe 'Twitter::CallbacksController', type: :request do
|
|||||||
let(:raw_response) { double }
|
let(:raw_response) { double }
|
||||||
let(:user_object_rsponse) do
|
let(:user_object_rsponse) do
|
||||||
OpenStruct.new(
|
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,
|
status: 200,
|
||||||
success?: true
|
success?: true
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user