From 80ff0b9f1c07eae7668680fd12335ffa218e53ac Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sun, 9 Sep 2007 00:18:55 +0000 Subject: 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 --- actionpack/test/controller/resources_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionpack/test/controller/resources_test.rb') 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 }, -- cgit v1.2.3