Codebase list ruby-omniauth-facebook / 768ab1d
dont force lowest FB version for requests frausto 9 years ago
2 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
5656 end
5757
5858 def raw_info
59 @raw_info ||= access_token.get('/me', info_options).parsed || {}
59 @raw_info ||= access_token.get('me', info_options).parsed || {}
6060 end
6161
6262 def info_options
249249 strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
250250 strategy.stubs(:access_token).returns(@access_token)
251251 params = {:params => @options}
252 @access_token.expects(:get).with('/me', params).returns(stub_everything('OAuth2::Response'))
252 @access_token.expects(:get).with('me', params).returns(stub_everything('OAuth2::Response'))
253253 strategy.raw_info
254254 end
255255
258258 strategy.stubs(:access_token).returns(@access_token)
259259 strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
260260 params = {:params => @options}
261 @access_token.expects(:get).with('/me', params).returns(stub_everything('OAuth2::Response'))
261 @access_token.expects(:get).with('me', params).returns(stub_everything('OAuth2::Response'))
262262 strategy.raw_info
263263 end
264264
267267 strategy.stubs(:access_token).returns(@access_token)
268268 strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
269269 params = {:params => {:appsecret_proof => @appsecret_proof, :fields => 'about'}}
270 @access_token.expects(:get).with('/me', params).returns(stub_everything('OAuth2::Response'))
270 @access_token.expects(:get).with('me', params).returns(stub_everything('OAuth2::Response'))
271271 strategy.raw_info
272272 end
273273
280280 raw_response.stubs(:headers).returns({'Content-Type' => 'application/json' })
281281 oauth2_response = OAuth2::Response.new(raw_response)
282282 params = {:params => @options}
283 @access_token.stubs(:get).with('/me', params).returns(oauth2_response)
283 @access_token.stubs(:get).with('me', params).returns(oauth2_response)
284284 assert_kind_of Hash, strategy.raw_info
285285 assert_equal 'thar', strategy.raw_info['ohai']
286286 end
290290 strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
291291 oauth2_response = stub('OAuth2::Response', :parsed => false)
292292 params = {:params => @options}
293 @access_token.stubs(:get).with('/me', params).returns(oauth2_response)
293 @access_token.stubs(:get).with('me', params).returns(oauth2_response)
294294 assert_kind_of Hash, strategy.raw_info
295295 assert_equal({}, strategy.raw_info)
296296 end