@@ -25,7 +25,7 @@ def setup
25
25
@client_id = 'DUMMY_CLIENT_ID'
26
26
@client_secret = 'DUMMY_CLIENT_SECRET'
27
27
@scope = 'user_profile'
28
- @options = { : scope => @scope , : provider_ignores_state => true }
28
+ @options = { scope : @scope , provider_ignores_state : true }
29
29
@authorization_code = 'DUMMY_AUTH_CODE'
30
30
@access_token = 'DUMMY_TOKEN'
31
31
@refresh_token = 'DUMMY_REFRESH_TOKEN'
@@ -43,16 +43,16 @@ def add_mock_exchange_token
43
43
secret = Base64 . strict_encode64 ( "#{ @client_id } :#{ @client_secret } " )
44
44
headers = { 'Authorization' => "Basic #{ secret } " }
45
45
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 , headers : res_headers )
47
47
end
48
48
49
49
def dummy_token_response
50
50
{
51
- : access_token => @access_token ,
52
- : token_type => 'bearer' ,
53
- : refresh_token => @refresh_token ,
54
- : expires_in => 3600 ,
55
- : scope => 'user_profile'
51
+ access_token : @access_token ,
52
+ token_type : 'bearer' ,
53
+ refresh_token : @refresh_token ,
54
+ expires_in : 3600 ,
55
+ scope : 'user_profile'
56
56
}
57
57
end
58
58
@@ -61,55 +61,55 @@ def add_mock_user_info
61
61
url = 'https://zoom.us/v2/users/me'
62
62
headers = { 'Authorization' => "Bearer #{ @access_token } " }
63
63
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 )
64
+ stub_request ( :get , url ) . with ( headers : headers ) . to_return ( status : 200 , body : dummy_user_info_response . to_json , headers : res_headers )
65
65
end
66
66
67
67
def add_mock_user_info_then_fail_because_of_missing_scope
68
68
WebMock . enable!
69
69
url = 'https://zoom.us/v2/users/me'
70
- response = { : code => 124 , : message => 'Invalid access token.' }
70
+ response = { code : 124 , message : 'Invalid access token.' }
71
71
headers = { 'Authorization' => "Bearer #{ @access_token } " }
72
72
res_headers = { 'Content-Type' => 'application/json' }
73
- stub_request ( :get , url ) . with ( : headers => headers ) . to_return ( : status => 400 , : body => response . to_json , : headers => res_headers )
73
+ stub_request ( :get , url ) . with ( headers : headers ) . to_return ( status : 400 , body : response . to_json , headers : res_headers )
74
74
end
75
75
76
76
def add_mock_user_info_then_fail_because_of_unknown
77
77
WebMock . enable!
78
78
url = 'https://zoom.us/v2/users/me'
79
- response = { : code => 999 , : message => 'Unknown Error' }
79
+ response = { code : 999 , message : 'Unknown Error' }
80
80
headers = { 'Authorization' => "Bearer #{ @access_token } " }
81
81
res_headers = { 'Content-Type' => 'application/json' }
82
- stub_request ( :get , url ) . with ( : headers => headers ) . to_return ( : status => 500 , : body => response . to_json , : headers => res_headers )
82
+ stub_request ( :get , url ) . with ( headers : headers ) . to_return ( status : 500 , body : response . to_json , headers : res_headers )
83
83
end
84
84
85
85
def dummy_user_info_response
86
86
{
87
- :id => 'KdYKjnimT4KPd8FFgQt9FQ' ,
88
- : first_name => 'Jane' ,
89
- : last_name => 'Dev' ,
90
- : email => 'jane.dev@email.com' ,
91
- : type => 2 ,
92
- : role_name => 'Owner' ,
93
- : pmi => 1_234_567_890 ,
94
- : use_pmi => false ,
95
- : vanity_url => 'https://janedevinc.zoom.us/my/janedev' ,
96
- : personal_meeting_url => 'https://janedevinc.zoom.us/j/1234567890' ,
97
- : timezone => 'America/Denver' ,
98
- : verified => 1 ,
99
- : dept => '' ,
100
- : created_at => '2019-04-05T15:24:32Z' ,
101
- : last_login_time => '2019-12-16T18:02:48Z' ,
102
- : last_client_version => '4.6.12611.1124(mac)' ,
103
- : pic_url => 'https://janedev.zoom.us/p/KdYKjnimFR5Td8KKdQt9FQ/19f6430f-ca72-4154-8998-ede6be4542c7-837' ,
104
- : host_key => '533895' ,
105
- : jid => 'kdykjnimt4kpd8kkdqt9fq@xmpp.zoom.us' ,
106
- : group_ids => [ ] ,
107
- : im_group_ids => [ '3NXCD9VFTCOUH8LD-QciGw' ] ,
108
- : account_id => 'gVcjZnYYRLDbb_MfgHuaxg' ,
109
- : language => 'en-US' ,
110
- : phone_country => 'US' ,
111
- : phone_number => '+1 1234567891' ,
112
- : status => 'active'
87
+ id : 'KdYKjnimT4KPd8FFgQt9FQ' ,
88
+ first_name : 'Jane' ,
89
+ last_name : 'Dev' ,
90
+ email : 'jane.dev@email.com' ,
91
+ type : 2 ,
92
+ role_name : 'Owner' ,
93
+ pmi : 1_234_567_890 ,
94
+ use_pmi : false ,
95
+ vanity_url : 'https://janedevinc.zoom.us/my/janedev' ,
96
+ personal_meeting_url : 'https://janedevinc.zoom.us/j/1234567890' ,
97
+ timezone : 'America/Denver' ,
98
+ verified : 1 ,
99
+ dept : '' ,
100
+ created_at : '2019-04-05T15:24:32Z' ,
101
+ last_login_time : '2019-12-16T18:02:48Z' ,
102
+ last_client_version : '4.6.12611.1124(mac)' ,
103
+ pic_url : 'https://janedev.zoom.us/p/KdYKjnimFR5Td8KKdQt9FQ/19f6430f-ca72-4154-8998-ede6be4542c7-837' ,
104
+ host_key : '533895' ,
105
+ jid : 'kdykjnimt4kpd8kkdqt9fq@xmpp.zoom.us' ,
106
+ group_ids : [ ] ,
107
+ im_group_ids : [ '3NXCD9VFTCOUH8LD-QciGw' ] ,
108
+ account_id : 'gVcjZnYYRLDbb_MfgHuaxg' ,
109
+ language : 'en-US' ,
110
+ phone_country : 'US' ,
111
+ phone_number : '+1 1234567891' ,
112
+ status : 'active'
113
113
}
114
114
end
115
115
end
0 commit comments