aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAndrey A.I. Sitnik <andrey@sitnik.ru>2011-08-22 09:36:36 +1100
committerAndrey A.I. Sitnik <andrey@sitnik.ru>2011-08-22 09:36:36 +1100
commit18b2223b3290c4b3daa310edfc06b4d51161c312 (patch)
tree4107f4333868c2c495ca0e596d41533f291c231a /actionpack/test
parent63d3809e31cc9c0ed3b2e30617310407ae614fd4 (diff)
downloadrails-18b2223b3290c4b3daa310edfc06b4d51161c312.tar.gz
rails-18b2223b3290c4b3daa310edfc06b4d51161c312.tar.bz2
rails-18b2223b3290c4b3daa310edfc06b4d51161c312.zip
Allow to debug assets by config.assets.debug
Diffstat (limited to 'actionpack/test')
-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