aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/sprockets_helper_test.rb
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-08-22 11:50:27 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2011-08-22 11:50:27 -0700
commit0b6da0c65497df4ee9d2f9313ccb9909bdc842e9 (patch)
tree8851f6064b21f98f696a32b1caa47d1d8902029b /actionpack/test/template/sprockets_helper_test.rb
parent999e7ea47d04c4fe01a195fdb8abd39b6bd38fa8 (diff)
parent18b2223b3290c4b3daa310edfc06b4d51161c312 (diff)
downloadrails-0b6da0c65497df4ee9d2f9313ccb9909bdc842e9.tar.gz
rails-0b6da0c65497df4ee9d2f9313ccb9909bdc842e9.tar.bz2
rails-0b6da0c65497df4ee9d2f9313ccb9909bdc842e9.zip
Merge pull request #2411 from ai/debug_assets_by_config
Debug assets by config
Diffstat (limited to 'actionpack/test/template/sprockets_helper_test.rb')
-rw-r--r--actionpack/test/template/sprockets_helper_test.rb20
1 files changed, 6 insertions, 14 deletions
diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb
index d303acad0f..cac277cf11 100644
--- a/actionpack/test/template/sprockets_helper_test.rb
+++ b/actionpack/test/template/sprockets_helper_test.rb
@@ -141,8 +141,6 @@ class SprocketsHelperTest < ActionView::TestCase
end
test "javascript include tag" do
- Rails.env.stubs(:test?).returns(false)
-
assert_match %r{<script src="/assets/application-[0-9a-f]+.js" type="text/javascript"></script>},
javascript_include_tag(:application)
@@ -156,14 +154,12 @@ class SprocketsHelperTest < ActionView::TestCase
assert_match %r{<script src=\"/assets/xmlhr-[0-9a-f]+.js" type=\"text/javascript\"></script>\n<script src=\"/assets/extra-[0-9a-f]+.js" type=\"text/javascript\"></script>},
javascript_include_tag("xmlhr", "extra")
- Rails.env.stubs(:test?).returns(true)
+ assert_match %r{<script src="/assets/xmlhr-[0-9a-f]+.js\?body=1" type="text/javascript"></script>\n<script src="/assets/application-[0-9a-f]+.js\?body=1" type="text/javascript"></script>},
+ javascript_include_tag(:application, :debug => true)
+ @config.assets.debug = true
assert_match %r{<script src="/assets/xmlhr-[0-9a-f]+.js\?body=1" type="text/javascript"></script>\n<script src="/assets/application-[0-9a-f]+.js\?body=1" type="text/javascript"></script>},
javascript_include_tag(:application)
-
- assert_match %r{<script src="/assets/application-[0-9a-f]+.js\" type="text/javascript"></script>},
- javascript_include_tag(:application, :debug => false)
-
end
test "stylesheet path" do
@@ -180,8 +176,6 @@ class SprocketsHelperTest < ActionView::TestCase
end
test "stylesheet link tag" do
- Rails.env.stubs(:test?).returns(false)
-
assert_match %r{<link href="/assets/application-[0-9a-f]+.css" media="screen" rel="stylesheet" type="text/css" />},
stylesheet_link_tag(:application)
@@ -200,14 +194,12 @@ class SprocketsHelperTest < ActionView::TestCase
assert_match %r{<link href="/assets/style-[0-9a-f]+.css" media="screen" rel="stylesheet" type="text/css" />\n<link href="/assets/extra-[0-9a-f]+.css" media="screen" rel="stylesheet" type="text/css" />},
stylesheet_link_tag("style", "extra")
- Rails.env.stubs(:test?).returns(true)
+ assert_match %r{<link href="/assets/style-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />\n<link href="/assets/application-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />},
+ stylesheet_link_tag(:application, :debug => true)
+ @config.assets.debug = true
assert_match %r{<link href="/assets/style-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />\n<link href="/assets/application-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />},
stylesheet_link_tag(:application)
-
- assert_match %r{<link href="/assets/application-[0-9a-f]+.css" media="screen" rel="stylesheet" type="text/css" />},
- stylesheet_link_tag(:application, :debug => false)
-
end
test "alternate asset prefix" do