Skip to content

Commit

Permalink
fix: response body in twitter callback (#6907)
Browse files Browse the repository at this point in the history
* fix: response body

* fix: tests
  • Loading branch information
scmmishra committed Apr 14, 2023
1 parent 4d49b81 commit 1886d4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/twitter/callbacks_controller.rb
Expand Up @@ -62,7 +62,7 @@ def save_profile_image(inbox)

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
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/twitter/callbacks_controller_spec.rb
Expand Up @@ -6,7 +6,7 @@
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
)
Expand Down

0 comments on commit 1886d4c

Please sign in to comment.