simplify test for image size option
Mark Dodwell
10 years ago
114 | 114 | @options = { :image_size => { :width => 123, :height => 987 } } |
115 | 115 | raw_info = { 'name' => 'Fred Smith', 'id' => '321' } |
116 | 116 | 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'] | |
124 | 118 | end |
125 | 119 | end |
126 | 120 |