Permalink
Browse files

Add test case for load initializers before routing behavior.

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
sikachu authored and josevalim committed Jan 21, 2010
1 parent 5c53ffe commit cc6f16685ca68900720e5813bd2adca078428f2e
Showing with 28 additions and 0 deletions.
  1. +28 −0 railties/test/application/routing_test.rb
@@ -176,5 +176,33 @@ def baz
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

0 comments on commit cc6f166

Please sign in to comment.