1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

don't manipulate the testclass, just add helpers to the instance

This commit is contained in:
Aaron Patterson 2014-05-08 15:07:33 -07:00
parent 66274d6d03
commit 2a10028ee3

View file

@ -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