mirror of
https://github.com/simi/omniauth-facebook.git
synced 2022-11-09 12:32:45 -05:00
Merge pull request #94 from weilu/use-hash-rocket-syntax
Use hash rocket syntax for ruby-1.8.7
This commit is contained in:
commit
9ae9f282b9
2 changed files with 4 additions and 4 deletions
|
@ -219,14 +219,14 @@ module OmniAuth
|
|||
|
||||
def image_url uid, options
|
||||
uri_class = options[:secure_image_url] ? URI::HTTPS : URI::HTTP
|
||||
url = uri_class.build({host: 'graph.facebook.com', path: "/#{uid}/picture"})
|
||||
url = uri_class.build({:host => 'graph.facebook.com', :path => "/#{uid}/picture"})
|
||||
|
||||
query = if options[:image_size].is_a?(String)
|
||||
{ type: options[:image_size] }
|
||||
{ :type => options[:image_size] }
|
||||
elsif options[:image_size].is_a?(Hash)
|
||||
options[:image_size]
|
||||
end
|
||||
url.query = URI.encode_www_form(query) if query
|
||||
url.query = Rack::Utils.build_query(query) if query
|
||||
|
||||
url.to_s
|
||||
end
|
||||
|
|
|
@ -118,7 +118,7 @@ class InfoTest < StrategyTestCase
|
|||
end
|
||||
|
||||
test 'returns the image with width and height specified in the `image_size` option' do
|
||||
@options = { :image_size => { width: 123, height: 987 } }
|
||||
@options = { :image_size => { :width => 123, :height => 987 } }
|
||||
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
||||
strategy.stubs(:raw_info).returns(raw_info)
|
||||
assert_equal 'http://graph.facebook.com/321/picture?width=123&height=987', strategy.info['image']
|
||||
|
|
Loading…
Reference in a new issue