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-22 17:58:03 +0100
commitcc6f16685ca68900720e5813bd2adca078428f2e (patch)
tree254bd62fe5e4978abaf811ed43890d011674ed7a /railties
parent5c53ffe1dbb3ece45ed58ed5b005e9c104f61842 (diff)
downloadrails-cc6f16685ca68900720e5813bd2adca078428f2e.tar.gz
rails-cc6f16685ca68900720e5813bd2adca078428f2e.tar.bz2
rails-cc6f16685ca68900720e5813bd2adca078428f2e.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