aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2010-01-21 23:30:17 +0700
committerJosé Valim <jose.valim@gmail.com>2010-01-21 17:45:21 +0100
commit2df1810cf3cde71fb15594eac022cab27d6497a1 (patch)
treea014bdc5ab18d4dca2ae521659cbb97ac80cfa3a /railties
parentfc4f237864541f5012f9b8cc8e0ec81960377e55 (diff)
downloadrails-2df1810cf3cde71fb15594eac022cab27d6497a1.tar.gz
rails-2df1810cf3cde71fb15594eac022cab27d6497a1.tar.bz2
rails-2df1810cf3cde71fb15594eac022cab27d6497a1.zip
Add test case for load initializers before routing behavior.
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties')
-rw-r--r--railties/test/application/routing_test.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb
index 725dd06929..50cb9e3acc 100644
--- a/railties/test/application/routing_test.rb
+++ b/railties/test/application/routing_test.rb
@@ -176,5 +176,33 @@ module ApplicationTests
get '/foo'
assert_equal 'baz', last_response.body
end
+
+ test 'resource routing with irrigular inflection' do
+ app_file 'config/initializers/inflection.rb', <<-RUBY
+ ActiveSupport::Inflector.inflections do |inflect|
+ inflect.irregular 'yazi', 'yazilar'
+ end
+ RUBY
+
+ app_file 'config/routes.rb', <<-RUBY
+ AppTemplate::Application.routes.draw do |map|
+ resources :yazilar
+ end
+ RUBY
+
+ controller 'yazilar', <<-RUBY
+ class YazilarController < ActionController::Base
+ def index
+ render :text => 'yazilar#index'
+ end
+ end
+ RUBY
+
+ get '/yazilars'
+ assert_equal 404, last_response.status
+
+ get '/yazilar'
+ assert_equal 200, last_response.status
+ end
end
end