test/units/path_test.rb in imgix-0.3.3 vs test/units/path_test.rb in imgix-0.3.4

- old
+ new

@@ -51,11 +51,11 @@ def test_host_is_required assert_raises(ArgumentError) {Imgix::Client.new} end def test_token_is_optional - client = Imgix::Client.new(host: 'demo.imgix.net') + client = Imgix::Client.new(host: 'demo.imgix.net', :include_library_param => false) url = 'http://demo.imgix.net/images/demo.png?' path = client.path('/images/demo.png') assert_equal url, path.to_url end @@ -69,11 +69,18 @@ def test_full_url_with_a_space path = 'https://my-demo-site.com/files/133467012/avatar icon.png' assert_equal "http://demo.imgix.net/#{CGI.escape(path)}?&s=8943817bed50811f6ceedd8f4b84169d", client.path(path).to_url end + def test_include_library_param + client = Imgix::Client.new(host: 'demo.imgix.net') # enabled by default + url = client.path('/images/demo.png').to_url + + assert_equal "ixlib=rb-#{Imgix::VERSION}", URI(url).query + end + private def client - @client ||= Imgix::Client.new(:host => 'demo.imgix.net', :token => '10adc394') + @client ||= Imgix::Client.new(:host => 'demo.imgix.net', :token => '10adc394', :include_library_param => false) end end