Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 2a10028ee341a9e45904552924eb94b189df6565 1 parent 66274d6
@tenderlove tenderlove authored
Showing with 11 additions and 10 deletions.
  1. +11 −10 actionview/test/activerecord/polymorphic_routes_test.rb
View
21 actionview/test/activerecord/polymorphic_routes_test.rb
@@ -207,14 +207,15 @@ def test_with_new_record
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 @@ def with_namespaced_routes(name)
end
end
- self.class.send(:include, @routes.url_helpers)
+ extend @routes.url_helpers
yield
end
end
@@ -593,7 +594,7 @@ def with_test_routes(options = {})
resources :model_delegates
end
- self.class.send(:include, @routes.url_helpers)
+ extend @routes.url_helpers
yield
end
end
@@ -615,7 +616,7 @@ def with_admin_test_routes(options = {})
end
end
- self.class.send(:include, @routes.url_helpers)
+ extend @routes.url_helpers
yield
end
end
@@ -634,7 +635,7 @@ def with_admin_and_site_test_routes(options = {})
end
end
- self.class.send(:include, @routes.url_helpers)
+ extend @routes.url_helpers
yield
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.