From 27159dff0fd0d3f8a6faececc35fffe55a5f3032 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sun, 22 May 2011 15:10:53 -0500 Subject: Add debug_asset support --- .../test/fixtures/sprockets/app/javascripts/application.js | 1 + .../test/fixtures/sprockets/app/stylesheets/application.css | 1 + actionpack/test/template/sprockets_helper_test.rb | 11 +++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/fixtures/sprockets/app/javascripts/application.js b/actionpack/test/fixtures/sprockets/app/javascripts/application.js index e69de29bb2..e611d2b129 100644 --- a/actionpack/test/fixtures/sprockets/app/javascripts/application.js +++ b/actionpack/test/fixtures/sprockets/app/javascripts/application.js @@ -0,0 +1 @@ +//= require xmlhr diff --git a/actionpack/test/fixtures/sprockets/app/stylesheets/application.css b/actionpack/test/fixtures/sprockets/app/stylesheets/application.css index e69de29bb2..2365eaa4cd 100644 --- a/actionpack/test/fixtures/sprockets/app/stylesheets/application.css +++ b/actionpack/test/fixtures/sprockets/app/stylesheets/application.css @@ -0,0 +1 @@ +/*= require style */ diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index 8d3be09a4f..4ce8c672cd 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -13,6 +13,7 @@ class SprocketsHelperTest < ActionView::TestCase super @controller = BasicController.new + @controller.stubs(:params).returns({}) @request = Class.new do def protocol() 'http://' end @@ -85,10 +86,13 @@ class SprocketsHelperTest < ActionView::TestCase sprockets_javascript_include_tag("xmlhr.js") assert_equal '', sprockets_javascript_include_tag("http://www.example.com/xmlhr") + + assert_equal "\n", + sprockets_javascript_include_tag(:application, :debug => true) end test "stylesheet path" do - assert_equal "/assets/application-d41d8cd98f00b204e9800998ecf8427e.css", asset_path(:application, "css") + assert_equal "/assets/application-68b329da9893e34099c7d8ad5cb9c940.css", asset_path(:application, "css") assert_equal "/assets/style-d41d8cd98f00b204e9800998ecf8427e.css", asset_path("style", "css") assert_equal "/assets/dir/style-d41d8cd98f00b204e9800998ecf8427e.css", asset_path("dir/style.css", "css") @@ -101,7 +105,7 @@ class SprocketsHelperTest < ActionView::TestCase end test "stylesheet link tag" do - assert_equal '', + assert_equal '', sprockets_stylesheet_link_tag(:application) assert_equal '', @@ -115,5 +119,8 @@ class SprocketsHelperTest < ActionView::TestCase sprockets_stylesheet_link_tag("style", :media => "all") assert_equal '', sprockets_stylesheet_link_tag("style", :media => "print") + + assert_equal "\n", + sprockets_stylesheet_link_tag(:application, :debug => true) end end -- cgit v1.2.3