FIX: canonical url should not use the CDN

This commit is contained in:
Régis Hanol
2013-12-17 00:35:34 +01:00
parent 7fb985a02e
commit 2ce75a8523
3 changed files with 22 additions and 4 deletions
+15 -1
View File
@@ -33,10 +33,24 @@ describe UrlHelper do
helper.absolute("http://www.discourse.org").should == "http://www.discourse.org"
end
it "changes a relative url to an absolute one" do
it "changes a relative url to an absolute one using base url by default" do
helper.absolute("/path/to/file").should == "http://test.localhost/path/to/file"
end
it "changes a relative url to an absolute one using the cdn when enabled" do
Rails.configuration.action_controller.stubs(:asset_host).returns("http://my.cdn.com")
helper.absolute("/path/to/file").should == "http://my.cdn.com/path/to/file"
end
end
describe "#absolute_without_cdn" do
it "changes a relative url to an absolute one using base url even when cdn is enabled" do
Rails.configuration.action_controller.stubs(:asset_host).returns("http://my.cdn.com")
helper.absolute_without_cdn("/path/to/file").should == "http://test.localhost/path/to/file"
end
end
describe "#schemaless" do