test/unit/juicer/asset/path_test.rb in psyho_juicer-1.0.0 vs test/unit/juicer/asset/path_test.rb in psyho_juicer-1.0.7
- old
+ new
@@ -53,10 +53,16 @@
should "strip trailing slash and add scheme in hosts" do
asset = Juicer::Asset::Path.new "../images/logo.png", :hosts => ["localhost/", "http://dev.server", "some.server/"]
assert_equal ["http://localhost", "http://dev.server", "http://some.server"], asset.hosts
end
+
+ should "accept protocol-less hosts" do
+ asset = Juicer::Asset::Path.new "../images/logo.png", :hosts => ["localhost/", "//dev.server", "some.server/"]
+
+ assert_equal ["http://localhost", "//dev.server", "http://some.server"], asset.hosts
+ end
end
context "asset absolute path" do
should "raise exception without document root" do
asset = Juicer::Asset::Path.new "../images/logo.png"
@@ -163,10 +169,10 @@
end
should "return URL with mtime query parameter and default parameter name" do
mtime = File.mtime(@filename).to_i
result = "#@filename?jcb=#{mtime}"
- Juicer::CacheBuster.stubs(:soft).with(File.expand_path(@filename)).returns(result)
+ Juicer::CacheBuster.stubs(:soft).with(File.expand_path(@filename), :revision_type => nil).returns(result)
assert_equal result, @asset.relative_path(:cache_buster_type => :soft)
end
should "return URL with mtime query parameter" do