From cc6f16685ca68900720e5813bd2adca078428f2e Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Thu, 21 Jan 2010 23:30:17 +0700 Subject: Add test case for load initializers before routing behavior. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- railties/test/application/routing_test.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'railties') 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 -- cgit v1.2.3