test/units/domains_test.rb in imgix-0.3.2 vs test/units/domains_test.rb in imgix-0.3.3

- old
+ new

@@ -35,19 +35,29 @@ path = client.path('/bridge.png') assert_equal 'http://demos-3.imgix.net/bridge.png?&s=13e68f249172e5f790344e85e7cdb14b', path.to_url path = client.path('/bridge.png') assert_equal 'http://demos-1.imgix.net/bridge.png?&s=13e68f249172e5f790344e85e7cdb14b', path.to_url - end def test_strips_out_protocol client = Imgix::Client.new(:host => "http://demos-1.imgix.net", :token => '10adc394') path = client.path('/bridge.png') assert_equal 'http://demos-1.imgix.net/bridge.png?&s=13e68f249172e5f790344e85e7cdb14b', path.to_url - end + def test_with_full_paths + client = Imgix::Client.new(:hosts => [ + "demos-1.imgix.net", + "demos-2.imgix.net", + "demos-3.imgix.net", + ], + :token => '10adc394', + :shard_strategy => :cycle) + + path = 'https://google.com/cats.gif' + assert_equal "http://demos-1.imgix.net/#{CGI.escape(path)}?&s=4c3ff935011f0d2251800e6a2bb68ee5", client.path(path).to_url + end end