@@ -9,11 +9,11 @@ class StrategyTest < StrategyTestCase
9
9
10
10
class ClientTest < StrategyTestCase
11
11
test 'has correct Facebook site' do
12
- assert_equal 'https://graph.facebook.com/v3 .0' , strategy . client . site
12
+ assert_equal 'https://graph.facebook.com/v4 .0' , strategy . client . site
13
13
end
14
14
15
15
test 'has correct authorize url' do
16
- assert_equal 'https://www.facebook.com/v3 .0/dialog/oauth' , strategy . client . options [ :authorize_url ]
16
+ assert_equal 'https://www.facebook.com/v4 .0/dialog/oauth' , strategy . client . options [ :authorize_url ]
17
17
end
18
18
19
19
test 'has correct token url with versioning' do
@@ -99,7 +99,7 @@ class InfoTest < StrategyTestCase
99
99
@options = { secure_image_url : true }
100
100
raw_info = { 'name' => 'Fred Smith' , 'id' => '321' }
101
101
strategy . stubs ( :raw_info ) . returns ( raw_info )
102
- assert_equal 'https://graph.facebook.com/v3 .0/321/picture' , strategy . info [ 'image' ]
102
+ assert_equal 'https://graph.facebook.com/v4 .0/321/picture' , strategy . info [ 'image' ]
103
103
end
104
104
105
105
test 'returns the image_url based of the client site' do
@@ -113,14 +113,14 @@ class InfoTest < StrategyTestCase
113
113
@options = { image_size : 'normal' }
114
114
raw_info = { 'name' => 'Fred Smith' , 'id' => '321' }
115
115
strategy . stubs ( :raw_info ) . returns ( raw_info )
116
- assert_equal 'http://graph.facebook.com/v3 .0/321/picture?type=normal' , strategy . info [ 'image' ]
116
+ assert_equal 'http://graph.facebook.com/v4 .0/321/picture?type=normal' , strategy . info [ 'image' ]
117
117
end
118
118
119
119
test 'returns the image with size specified as a symbol in the `image_size` option' do
120
120
@options = { image_size : :normal }
121
121
raw_info = { 'name' => 'Fred Smith' , 'id' => '321' }
122
122
strategy . stubs ( :raw_info ) . returns ( raw_info )
123
- assert_equal 'http://graph.facebook.com/v3 .0/321/picture?type=normal' , strategy . info [ 'image' ]
123
+ assert_equal 'http://graph.facebook.com/v4 .0/321/picture?type=normal' , strategy . info [ 'image' ]
124
124
end
125
125
126
126
test 'returns the image with width and height specified in the `image_size` option' do
@@ -129,7 +129,7 @@ class InfoTest < StrategyTestCase
129
129
strategy . stubs ( :raw_info ) . returns ( raw_info )
130
130
assert_match 'width=123' , strategy . info [ 'image' ]
131
131
assert_match 'height=987' , strategy . info [ 'image' ]
132
- assert_match 'http://graph.facebook.com/v3 .0/321/picture?' , strategy . info [ 'image' ]
132
+ assert_match 'http://graph.facebook.com/v4 .0/321/picture?' , strategy . info [ 'image' ]
133
133
end
134
134
end
135
135
@@ -176,7 +176,7 @@ def setup
176
176
177
177
test 'returns the facebook avatar url' do
178
178
@raw_info [ 'id' ] = '321'
179
- assert_equal 'http://graph.facebook.com/v3 .0/321/picture' , strategy . info [ 'image' ]
179
+ assert_equal 'http://graph.facebook.com/v4 .0/321/picture' , strategy . info [ 'image' ]
180
180
end
181
181
182
182
test 'returns the Facebook link as the Facebook url' do
@@ -258,15 +258,15 @@ def setup
258
258
@options = { appsecret_proof : @appsecret_proof , fields : 'name,email' }
259
259
end
260
260
261
- test 'performs a GET to https://graph.facebook.com/v3 .0/me' do
261
+ test 'performs a GET to https://graph.facebook.com/v4 .0/me' do
262
262
strategy . stubs ( :appsecret_proof ) . returns ( @appsecret_proof )
263
263
strategy . stubs ( :access_token ) . returns ( @access_token )
264
264
params = { params : @options }
265
265
@access_token . expects ( :get ) . with ( 'me' , params ) . returns ( stub_everything ( 'OAuth2::Response' ) )
266
266
strategy . raw_info
267
267
end
268
268
269
- test 'performs a GET to https://graph.facebook.com/v3 .0/me with locale' do
269
+ test 'performs a GET to https://graph.facebook.com/v4 .0/me with locale' do
270
270
@options . merge! ( { locale : 'cs_CZ' } )
271
271
strategy . stubs ( :access_token ) . returns ( @access_token )
272
272
strategy . stubs ( :appsecret_proof ) . returns ( @appsecret_proof )
@@ -275,7 +275,7 @@ def setup
275
275
strategy . raw_info
276
276
end
277
277
278
- test 'performs a GET to https://graph.facebook.com/v3 .0/me with info_fields' do
278
+ test 'performs a GET to https://graph.facebook.com/v4 .0/me with info_fields' do
279
279
@options . merge! ( { info_fields : 'about' } )
280
280
strategy . stubs ( :access_token ) . returns ( @access_token )
281
281
strategy . stubs ( :appsecret_proof ) . returns ( @appsecret_proof )
@@ -284,7 +284,7 @@ def setup
284
284
strategy . raw_info
285
285
end
286
286
287
- test 'performs a GET to https://graph.facebook.com/v3 .0/me with default info_fields' do
287
+ test 'performs a GET to https://graph.facebook.com/v4 .0/me with default info_fields' do
288
288
strategy . stubs ( :access_token ) . returns ( @access_token )
289
289
strategy . stubs ( :appsecret_proof ) . returns ( @appsecret_proof )
290
290
params = { params : { appsecret_proof : @appsecret_proof , fields : 'name,email' } }
0 commit comments