From 2a10028ee341a9e45904552924eb94b189df6565 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 8 May 2014 15:07:33 -0700 Subject: don't manipulate the testclass, just add helpers to the instance --- .../test/activerecord/polymorphic_routes_test.rb | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'actionview/test/activerecord/polymorphic_routes_test.rb') diff --git a/actionview/test/activerecord/polymorphic_routes_test.rb b/actionview/test/activerecord/polymorphic_routes_test.rb index 8cdb8301fd..dead717190 100644 --- a/actionview/test/activerecord/polymorphic_routes_test.rb +++ b/actionview/test/activerecord/polymorphic_routes_test.rb @@ -207,14 +207,15 @@ class PolymorphicRoutesTest < ActionController::TestCase def test_new_record_arguments params = nil - extend Module.new { - define_method("projects_url") { |*args| - params = args - super(*args) - } - } with_test_routes do + extend Module.new { + define_method("projects_url") { |*args| + params = args + super(*args) + } + } + assert_url "http://example.com/projects", @project assert_equal [], params end @@ -571,7 +572,7 @@ class PolymorphicRoutesTest < ActionController::TestCase end end - self.class.send(:include, @routes.url_helpers) + extend @routes.url_helpers yield end end @@ -593,7 +594,7 @@ class PolymorphicRoutesTest < ActionController::TestCase resources :model_delegates end - self.class.send(:include, @routes.url_helpers) + extend @routes.url_helpers yield end end @@ -615,7 +616,7 @@ class PolymorphicRoutesTest < ActionController::TestCase end end - self.class.send(:include, @routes.url_helpers) + extend @routes.url_helpers yield end end @@ -634,7 +635,7 @@ class PolymorphicRoutesTest < ActionController::TestCase end end - self.class.send(:include, @routes.url_helpers) + extend @routes.url_helpers yield end end -- cgit v1.2.3