1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add test case for load initializers before routing behavior.

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Prem Sichanugrist 2010-01-21 23:30:17 +07:00 committed by José Valim
parent fc4f237864
commit 2df1810cf3

View file

@ -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