aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2012-10-15 13:30:24 -0500
committerJoshua Peek <josh@joshpeek.com>2012-10-15 13:30:24 -0500
commitc4276ddf3860128d4f64c795c8b5cf5258aaeab8 (patch)
tree040169c0411e2acc0bdc95ffecff952fd2219202 /actionpack/test
parent046ab843b84db1935047dbc796f5acae66c45a42 (diff)
downloadrails-c4276ddf3860128d4f64c795c8b5cf5258aaeab8.tar.gz
rails-c4276ddf3860128d4f64c795c8b5cf5258aaeab8.tar.bz2
rails-c4276ddf3860128d4f64c795c8b5cf5258aaeab8.zip
Ignore asset url query string or anchor when appending extensions and computing public path
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/asset_tag_helper_test.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb
index 26a229e2ba..eb1a54a81f 100644
--- a/actionpack/test/template/asset_tag_helper_test.rb
+++ b/actionpack/test/template/asset_tag_helper_test.rb
@@ -73,7 +73,12 @@ class AssetTagHelperTest < ActionView::TestCase
%(javascript_path("super/xmlhr")) => %(/javascripts/super/xmlhr.js),
%(javascript_path("/super/xmlhr.js")) => %(/super/xmlhr.js),
%(javascript_path("xmlhr.min")) => %(/javascripts/xmlhr.min.js),
- %(javascript_path("xmlhr.min.js")) => %(/javascripts/xmlhr.min.js)
+ %(javascript_path("xmlhr.min.js")) => %(/javascripts/xmlhr.min.js),
+
+ %(javascript_path("xmlhr.js?123")) => %(/javascripts/xmlhr.js?123),
+ %(javascript_path("xmlhr.js?body=1")) => %(/javascripts/xmlhr.js?body=1),
+ %(javascript_path("xmlhr.js#hash")) => %(/javascripts/xmlhr.js#hash),
+ %(javascript_path("xmlhr.js?123#hash")) => %(/javascripts/xmlhr.js?123#hash)
}
PathToJavascriptToTag = {
@@ -285,6 +290,14 @@ class AssetTagHelperTest < ActionView::TestCase
%(audio_tag(["audio.mp3", "audio.ogg"], :autobuffer => true, :controls => true)) => %(<audio autobuffer="autobuffer" controls="controls"><source src="/audios/audio.mp3" /><source src="/audios/audio.ogg" /></audio>)
}
+ FontPathToTag = {
+ %(font_path("font.eot")) => %(/fonts/font.eot),
+ %(font_path("font.eot#iefix")) => %(/fonts/font.eot#iefix),
+ %(font_path("font.woff")) => %(/fonts/font.woff),
+ %(font_path("font.ttf")) => %(/fonts/font.ttf),
+ %(font_path("font.ttf?123")) => %(/fonts/font.ttf?123)
+ }
+
def test_autodiscovery_link_tag_deprecated_types
result = nil
assert_deprecated do
@@ -466,6 +479,10 @@ class AssetTagHelperTest < ActionView::TestCase
AudioLinkToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
end
+ def test_font_path
+ FontPathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
+ end
+
def test_video_audio_tag_does_not_modify_options
options = {:autoplay => true}
video_tag('video', options)