aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-06-16 09:09:38 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-06-16 13:10:45 -0300
commit52d09638dfc07413956846a6319b145511a15757 (patch)
treefad79c3f8055a8589614c700adf37e2c00918ce2 /actionpack/test
parenta8e22aeadcf53a30893fbfbf6d446d504bd87b67 (diff)
downloadrails-52d09638dfc07413956846a6319b145511a15757.tar.gz
rails-52d09638dfc07413956846a6319b145511a15757.tar.bz2
rails-52d09638dfc07413956846a6319b145511a15757.zip
Merge pull request #6752 from steveklabnik/fix_5680
Respect absolute paths in compute_source_path.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/fixtures/public/foo/baz.css3
-rw-r--r--actionpack/test/template/asset_tag_helper_test.rb14
2 files changed, 14 insertions, 3 deletions
diff --git a/actionpack/test/fixtures/public/foo/baz.css b/actionpack/test/fixtures/public/foo/baz.css
new file mode 100644
index 0000000000..b5173fbef2
--- /dev/null
+++ b/actionpack/test/fixtures/public/foo/baz.css
@@ -0,0 +1,3 @@
+body {
+background: #000;
+}
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb
index e3f56ffea5..f4dedb0c81 100644
--- a/actionpack/test/template/asset_tag_helper_test.rb
+++ b/actionpack/test/template/asset_tag_helper_test.rb
@@ -1055,9 +1055,6 @@ class AssetTagHelperTest < ActionView::TestCase
assert !File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
end
-
-
-
def test_caching_stylesheet_include_tag_when_caching_off
ENV["RAILS_ASSET_ID"] = ""
config.perform_caching = false
@@ -1086,6 +1083,17 @@ class AssetTagHelperTest < ActionView::TestCase
assert !File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
end
+
+ def test_caching_stylesheet_include_tag_with_absolute_uri
+ ENV["RAILS_ASSET_ID"] = ""
+
+ assert_dom_equal(
+ %(<link href="/stylesheets/all.css" media="screen" rel="stylesheet" />),
+ stylesheet_link_tag("/foo/baz", :cache => true)
+ )
+
+ FileUtils.rm(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
+ end
end
class AssetTagHelperNonVhostTest < ActionView::TestCase