diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 5 | ||||
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/fixtures/public/foo/baz.css | 3 | ||||
-rw-r--r-- | actionpack/test/template/asset_tag_helper_test.rb | 14 |
4 files changed, 21 insertions, 5 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 306b8a93da..6cc1370105 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -1760,6 +1760,7 @@ class RackMountIntegrationTests < ActiveSupport::TestCase get 'account(/:action)' => "account#subscription" get 'pages/:page_id/:controller(/:action(/:id))' get ':controller/ping', :action => 'ping' + get 'こんにちは/世界', :controller => 'news', :action => 'index' match ':controller(/:action(/:id))(.:format)', :via => :all root :to => "news#index" } @@ -1876,6 +1877,10 @@ class RackMountIntegrationTests < ActiveSupport::TestCase assert_equal({:controller => 'people', :action => 'create', :person => { :name => 'Josh'}}, params) end + def test_unicode_path + assert_equal({:controller => 'news', :action => 'index'}, @routes.recognize_path(URI.parser.escape('こんにちは/世界'), :method => :get)) + end + private def sort_extras!(extras) if extras.length == 2 diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index fa4cb301eb..f15dd7214b 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -2472,7 +2472,7 @@ end class TestUnicodePaths < ActionDispatch::IntegrationTest Routes = ActionDispatch::Routing::RouteSet.new.tap do |app| app.draw do - get "/#{Rack::Utils.escape("ほげ")}" => lambda { |env| + get "/ほげ" => lambda { |env| [200, { 'Content-Type' => 'text/plain' }, []] }, :as => :unicode_path end @@ -2727,4 +2727,4 @@ class TestInvalidUrls < ActionDispatch::IntegrationTest assert_response :bad_request end end -end
\ No newline at end of file +end 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 7cc567c72d..bcc55189b9 100644 --- a/actionpack/test/template/asset_tag_helper_test.rb +++ b/actionpack/test/template/asset_tag_helper_test.rb @@ -1267,9 +1267,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 @@ -1298,6 +1295,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 |