From fd8f0b297822ba36002084faa36bd0320d3be4a7 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Wed, 5 Oct 2011 15:41:28 -0200 Subject: stylesheet_link_tag('/stylesheets/application') and similar helpers doesn't throw Sprockets::FileOutsidePaths exception anymore --- actionpack/test/template/sprockets_helper_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack/test/template/sprockets_helper_test.rb') diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index 08b66fec8b..db69f95130 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -219,6 +219,8 @@ class SprocketsHelperTest < ActionView::TestCase @config.assets.compile = true @config.assets.debug = true + assert_match %r{}, + javascript_include_tag('/javascripts/application') assert_match %r{\n}, javascript_include_tag(:application) end @@ -264,6 +266,9 @@ class SprocketsHelperTest < ActionView::TestCase @config.assets.compile = true @config.assets.debug = true + assert_match %r{}, + stylesheet_link_tag('/stylesheets/application') + assert_match %r{\n}, stylesheet_link_tag(:application) -- cgit v1.2.3 From aa491f6a9c90641a2d4115420b14e45514962834 Mon Sep 17 00:00:00 2001 From: lest Date: Tue, 22 Nov 2011 16:39:07 +0300 Subject: javascript_include_tag should add '.js' to sources that contain '.' --- actionpack/test/template/sprockets_helper_test.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'actionpack/test/template/sprockets_helper_test.rb') diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index db69f95130..26a504beb8 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -217,6 +217,9 @@ class SprocketsHelperTest < ActionView::TestCase assert_match %r{\n}, javascript_include_tag(:application, :debug => true) + assert_match %r{}, + javascript_include_tag('jquery.plugin', :digest => false) + @config.assets.compile = true @config.assets.debug = true assert_match %r{}, -- cgit v1.2.3 From d3bc12b27feb96e8799e2bcdc6e52b2704360aa3 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Tue, 29 Nov 2011 01:59:36 -0500 Subject: Handle correctly optional parameters for callable asset_host. --- actionpack/test/template/sprockets_helper_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/test/template/sprockets_helper_test.rb') diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index 26a504beb8..64fdd53e73 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -41,6 +41,10 @@ class SprocketsHelperTest < ActionView::TestCase @controller ? @controller.config : @config end + def compute_host(source, request, options = {}) + raise "Should never get here" + end + test "asset_path" do assert_match %r{/assets/logo-[0-9a-f]+.png}, asset_path("logo.png") @@ -125,6 +129,10 @@ class SprocketsHelperTest < ActionView::TestCase assert_raises ActionController::RoutingError do asset_path("logo.png") end + @config.asset_host = method :compute_host + assert_raises ActionController::RoutingError do + asset_path("logo.png") + end end test "image_tag" do -- cgit v1.2.3