aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/activerecord/polymorphic_routes_test.rb21
1 files changed, 19 insertions, 2 deletions
diff --git a/actionview/test/activerecord/polymorphic_routes_test.rb b/actionview/test/activerecord/polymorphic_routes_test.rb
index dead717190..bcdb4f4376 100644
--- a/actionview/test/activerecord/polymorphic_routes_test.rb
+++ b/actionview/test/activerecord/polymorphic_routes_test.rb
@@ -99,8 +99,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
def test_symbol
with_test_routes do
- assert_equal "http://example.com/projects", polymorphic_url(:projects)
- assert_equal "http://example.com/projects", url_for(:projects)
+ assert_url "http://example.com/projects", :projects
end
end
@@ -214,6 +213,11 @@ class PolymorphicRoutesTest < ActionController::TestCase
params = args
super(*args)
}
+
+ define_method("projects_path") { |*args|
+ params = args
+ super(*args)
+ }
}
assert_url "http://example.com/projects", @project
@@ -640,3 +644,16 @@ class PolymorphicRoutesTest < ActionController::TestCase
end
end
end
+
+class PolymorphicPathRoutesTest < PolymorphicRoutesTest
+ include ActionView::RoutingUrlFor
+ include ActionView::Context
+
+ attr_accessor :controller
+
+ def assert_url(url, args)
+ host = self.class.default_url_options[:host]
+
+ assert_equal url.sub(/http:\/\/#{host}/, ''), url_for(args)
+ end
+end