aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-09-28 20:13:24 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2011-09-28 20:13:24 -0300
commit64b0c8888b908ede5372e0a70cb4cb8731d372ba (patch)
treed0e73d457ff98985e3a155a8cba141dfa317b585 /actionpack/test/template
parentad304e9f7e4f244eabfd42e7cd768e3b41725875 (diff)
downloadrails-64b0c8888b908ede5372e0a70cb4cb8731d372ba.tar.gz
rails-64b0c8888b908ede5372e0a70cb4cb8731d372ba.tar.bz2
rails-64b0c8888b908ede5372e0a70cb4cb8731d372ba.zip
javascript_path and stylesheet_path should honor the asset pipelining
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/sprockets_helper_test.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb
index b1e6db7b34..fd3e01ec03 100644
--- a/actionpack/test/template/sprockets_helper_test.rb
+++ b/actionpack/test/template/sprockets_helper_test.rb
@@ -134,6 +134,22 @@ class SprocketsHelperTest < ActionView::TestCase
path_to_image("logo.png")
end
+ test "javascript_path" do
+ assert_match %r{/assets/application-[0-9a-f]+.js},
+ javascript_path("application.js")
+
+ assert_match %r{/assets/application-[0-9a-f]+.js},
+ path_to_javascript("application.js")
+ end
+
+ test "stylesheet_path" do
+ assert_match %r{/assets/application-[0-9a-f]+.css},
+ stylesheet_path("application.css")
+
+ assert_match %r{/assets/application-[0-9a-f]+.css},
+ path_to_stylesheet("application.css")
+ end
+
test "stylesheets served without a controller in do not use asset hosts when the default protocol is :request" do
@controller = nil
@config.action_controller.asset_host = "assets-%d.example.com"
@@ -157,7 +173,7 @@ class SprocketsHelperTest < ActionView::TestCase
asset_path("/images/logo.gif")
end
- test "javascript path" do
+ test "javascript path through asset_path" do
assert_match %r{/assets/application-[0-9a-f]+.js},
asset_path(:application, :ext => "js")
@@ -202,7 +218,7 @@ class SprocketsHelperTest < ActionView::TestCase
javascript_include_tag(:application)
end
- test "stylesheet path" do
+ test "stylesheet path through asset_path" do
assert_match %r{/assets/application-[0-9a-f]+.css}, asset_path(:application, :ext => "css")
assert_match %r{/assets/style-[0-9a-f]+.css}, asset_path("style", :ext => "css")