mirror of
https://github.com/simi/omniauth-facebook.git
synced 2022-11-09 12:32:45 -05:00
Fixes image url test
On Ruby 1.8.7 the order of hash key-value pairs is not guaranteed.
This commit is contained in:
parent
13c1eca2ae
commit
edacef8c40
1 changed files with 7 additions and 1 deletions
|
@ -121,7 +121,13 @@ class InfoTest < StrategyTestCase
|
|||
@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']
|
||||
image_url = strategy.info['image']
|
||||
path, query = image_url.split("?")
|
||||
query_params = Hash[*query.split("&").map {|pair| pair.split("=") }.flatten]
|
||||
|
||||
assert_equal 'http://graph.facebook.com/321/picture', path
|
||||
assert_equal '123', query_params['width']
|
||||
assert_equal '987', query_params['height']
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue