Codebase list ruby-omniauth-facebook / cf00da9
simplify test for image size option Mark Dodwell 10 years ago
1 changed file(s) with 1 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
114114 @options = { :image_size => { :width => 123, :height => 987 } }
115115 raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
116116 strategy.stubs(:raw_info).returns(raw_info)
117 image_url = strategy.info['image']
118 path, query = image_url.split("?")
119 query_params = Hash[*query.split("&").map {|pair| pair.split("=") }.flatten]
120
121 assert_equal 'http://graph.facebook.com/321/picture', path
122 assert_equal '123', query_params['width']
123 assert_equal '987', query_params['height']
117 assert_equal 'http://graph.facebook.com/321/picture?width=123&height=987', strategy.info['image']
124118 end
125119 end
126120