1
0
Fork 0
mirror of https://github.com/simi/omniauth-facebook.git synced 2022-11-09 12:32:45 -05:00

simplify test for image size option

This commit is contained in:
Mark Dodwell 2013-12-28 14:53:32 -08:00
parent 72fa7751f0
commit cf00da9f8b

View file

@ -115,13 +115,7 @@ class InfoTest < StrategyTestCase
@options = { :image_size => { :width => 123, :height => 987 } } @options = { :image_size => { :width => 123, :height => 987 } }
raw_info = { 'name' => 'Fred Smith', 'id' => '321' } raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
strategy.stubs(:raw_info).returns(raw_info) strategy.stubs(:raw_info).returns(raw_info)
image_url = strategy.info['image'] assert_equal 'http://graph.facebook.com/321/picture?width=123&height=987', 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
end end