aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-10-05 02:07:25 +0200
committerJosé Valim <jose.valim@gmail.com>2011-10-05 02:08:02 +0200
commit5711a35ad8faa3fb6d138b234cbe9acfad27a9a8 (patch)
tree9b40f5b0d2c29b21239b732fcb1830b7013db1cc /actionpack/test
parentac2f6bd6431311b1eae9d8ac6c217d2c2fbc2b3d (diff)
downloadrails-5711a35ad8faa3fb6d138b234cbe9acfad27a9a8.tar.gz
rails-5711a35ad8faa3fb6d138b234cbe9acfad27a9a8.tar.bz2
rails-5711a35ad8faa3fb6d138b234cbe9acfad27a9a8.zip
Ensure default_asset_host_protocol is respected, closes #2980.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/sprockets_helper_test.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb
index fd3e01ec03..f0fb783a93 100644
--- a/actionpack/test/template/sprockets_helper_test.rb
+++ b/actionpack/test/template/sprockets_helper_test.rb
@@ -75,8 +75,9 @@ class SprocketsHelperTest < ActionView::TestCase
end
test "with a simple asset host the url should default to protocol relative" do
+ @controller.config.default_asset_host_protocol = :relative
@controller.config.asset_host = "assets-%d.example.com"
- assert_match %r{//assets-\d.example.com/assets/logo-[0-9a-f]+.png},
+ assert_match %r{^//assets-\d.example.com/assets/logo-[0-9a-f]+.png},
asset_path("logo.png")
end
@@ -88,10 +89,11 @@ class SprocketsHelperTest < ActionView::TestCase
end
test "With a proc asset host that returns no protocol the url should be protocol relative" do
+ @controller.config.default_asset_host_protocol = :relative
@controller.config.asset_host = Proc.new do |asset|
"assets-999.example.com"
end
- assert_match %r{//assets-999.example.com/assets/logo-[0-9a-f]+.png},
+ assert_match %r{^//assets-999.example.com/assets/logo-[0-9a-f]+.png},
asset_path("logo.png")
end