提交 2df1810c 编写于 作者: P Prem Sichanugrist 提交者: José Valim

Add test case for load initializers before routing behavior.

Signed-off-by: NJosé Valim <jose.valim@gmail.com>
上级 fc4f2378
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册