@@ -39,11 +39,12 @@ def strategy
3939
4040 def add_mock_exchange_token
4141 WebMock . enable!
42- url = " https://zoom.us/oauth/token?code= #{ @authorization_code } &grant_type=authorization_code&redirect_uri=http://example.org/auth/zoom/callback"
42+ url = ' https://zoom.us/oauth/token'
4343 secret = Base64 . strict_encode64 ( "#{ @client_id } :#{ @client_secret } " )
44- headers = { 'Authorization' => "Basic #{ secret } " }
44+ headers = { 'Authorization' => "Basic #{ secret } " , 'Content-Type' => 'application/x-www-form-urlencoded' }
4545 res_headers = { 'Content-Type' => 'application/json' }
46- stub_request ( :post , url ) . with ( headers : headers ) . to_return ( status : 200 , body : dummy_token_response . to_json , headers : res_headers )
46+ stub_request ( :post , url ) . with ( headers : headers ) . to_return ( status : 200 , body : dummy_token_response . to_json ,
47+ headers : res_headers )
4748 end
4849
4950 def dummy_token_response
@@ -61,7 +62,8 @@ def add_mock_user_info
6162 url = 'https://zoom.us/v2/users/me'
6263 headers = { 'Authorization' => "Bearer #{ @access_token } " }
6364 res_headers = { 'Content-Type' => 'application/json' }
64- stub_request ( :get , url ) . with ( headers : headers ) . to_return ( status : 200 , body : dummy_user_info_response . to_json , headers : res_headers )
65+ stub_request ( :get , url ) . with ( headers : headers ) . to_return ( status : 200 , body : dummy_user_info_response . to_json ,
66+ headers : res_headers )
6567 end
6668
6769 def add_mock_user_info_then_fail_because_of_missing_scope
@@ -82,7 +84,7 @@ def add_mock_user_info_then_fail_because_of_unknown
8284 stub_request ( :get , url ) . with ( headers : headers ) . to_return ( status : 500 , body : response . to_json , headers : res_headers )
8385 end
8486
85- def dummy_user_info_response
87+ def dummy_user_info_response # rubocop:disable Metrics/MethodLength
8688 {
8789 id : 'KdYKjnimT4KPd8FFgQt9FQ' ,
8890 first_name : 'Jane' ,
0 commit comments