test/units/domains_test.rb in imgix-1.0.0 vs test/units/domains_test.rb in imgix-1.1.0
- old
+ new
@@ -1,9 +1,8 @@
require 'test_helper'
class DomainsTest < Imgix::Test
-
def test_deterministically_choosing_a_path
client = Imgix::Client.new(hosts: [
"demos-1.imgix.net",
"demos-2.imgix.net",
"demos-3.imgix.net",
@@ -41,9 +40,18 @@
assert_equal 'https://demos-1.imgix.net/bridge.png?s=0233fd6de51f20f11cff6b452b7a9a05', path.to_url
end
def test_strips_out_protocol
client = Imgix::Client.new(host: "http://demos-1.imgix.net",
+ secure_url_token: '10adc394',
+ include_library_param: false)
+
+ path = client.path('/bridge.png')
+ assert_equal 'https://demos-1.imgix.net/bridge.png?s=0233fd6de51f20f11cff6b452b7a9a05', path.to_url
+ end
+
+ def test_strips_out_trailing_slash
+ client = Imgix::Client.new(host: "http://demos-1.imgix.net/",
secure_url_token: '10adc394',
include_library_param: false)
path = client.path('/bridge.png')
assert_equal 'https://demos-1.imgix.net/bridge.png?s=0233fd6de51f20f11cff6b452b7a9a05', path.to_url