diff options
author | Michael Koziarski <michael@koziarski.com> | 2007-09-09 00:18:55 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2007-09-09 00:18:55 +0000 |
commit | 80ff0b9f1c07eae7668680fd12335ffa218e53ac (patch) | |
tree | 42307295c7d16ee3a778ec74b6f3becb0b5fb2ab /actionpack/test/controller/resources_test.rb | |
parent | 7ace0a654c46cf9ca57f42981c826eace21fa42c (diff) | |
download | rails-80ff0b9f1c07eae7668680fd12335ffa218e53ac.tar.gz rails-80ff0b9f1c07eae7668680fd12335ffa218e53ac.tar.bz2 rails-80ff0b9f1c07eae7668680fd12335ffa218e53ac.zip |
Optimise named route generation when using positional arguments. Closes #9450 [Koz]
This change delivers significant performance benefits for the most
common usage scenarios for modern rails applications by avoiding the
costly trip through url_for. Initial benchmarks indicate this is
between 6 and 20 times as fast.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7421 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/resources_test.rb')
-rw-r--r-- | actionpack/test/controller/resources_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index 57b956e777..29c25e6cfc 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -26,6 +26,18 @@ module Backoffice end class ResourcesTest < Test::Unit::TestCase + + + # The assertions in these tests are incompatible with the hash method + # optimisation. This could indicate user level problems + def setup + ActionController::Routing.optimise_named_routes = false + end + + def tear_down + ActionController::Routing.optimise_named_routes = true + end + def test_should_arrange_actions resource = ActionController::Resources::Resource.new(:messages, :collection => { :rss => :get, :reorder => :post, :csv => :post }, |