Skip to content

Commit

Permalink
Add test case for load initializers before routing behavior.
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
sikachu authored and josevalim committed Jan 22, 2010
1 parent 5c53ffe commit cc6f166
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions railties/test/application/routing_test.rb
Expand Up @@ -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.