aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-04-12 12:40:40 +1200
committerMichael Koziarski <michael@koziarski.com>2008-04-12 12:40:40 +1200
commit063c393bf0a2eb762770c97f925b7c2867361ad4 (patch)
tree81eda9f330faa3cebbe1a77b19a68476cfc77eac /actionpack/test
parent4364c361b599f99bc2345ce4eb2d145b07ed8a0f (diff)
downloadrails-063c393bf0a2eb762770c97f925b7c2867361ad4.tar.gz
rails-063c393bf0a2eb762770c97f925b7c2867361ad4.tar.bz2
rails-063c393bf0a2eb762770c97f925b7c2867361ad4.zip
Allow alternative values for the 'new' and 'edit' actions in resourceful routes.
map.resource :schools, :as => 'escuelas', :path_names => { :new => 'nueva' } Closes #11181. [ivanvr]
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/resources_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb
index c62a2043d9..0f1ac30f04 100644
--- a/actionpack/test/controller/resources_test.rb
+++ b/actionpack/test/controller/resources_test.rb
@@ -76,6 +76,12 @@ class ResourcesTest < Test::Unit::TestCase
end
end
+ def test_override_paths_for_default_restful_actions
+ resource = ActionController::Resources::Resource.new(:messages,
+ :path_names => {:new => 'nuevo', :edit => 'editar'})
+ assert_equal resource.new_path, "#{resource.path}/nuevo"
+ end
+
def test_multiple_default_restful_routes
with_restful_routing :messages, :comments do
assert_simply_restful_for :messages