diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-08 15:07:33 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-08 15:07:33 -0700 |
commit | 2a10028ee341a9e45904552924eb94b189df6565 (patch) | |
tree | cd166d39056872e51189e7c1248b3aaf45051503 /actionview | |
parent | 66274d6d03874160502c39ea05d8d117f00a6c3b (diff) | |
download | rails-2a10028ee341a9e45904552924eb94b189df6565.tar.gz rails-2a10028ee341a9e45904552924eb94b189df6565.tar.bz2 rails-2a10028ee341a9e45904552924eb94b189df6565.zip |
don't manipulate the testclass, just add helpers to the instance
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/test/activerecord/polymorphic_routes_test.rb | 21 |
1 files changed, 11 insertions, 10 deletions
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 |