aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/middleware_test.rb2
-rw-r--r--railties/test/application/routing_test.rb28
-rw-r--r--railties/test/generators/plugin_generator_test.rb2
3 files changed, 30 insertions, 2 deletions
diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb
index 8c4247e840..31696598ce 100644
--- a/railties/test/application/middleware_test.rb
+++ b/railties/test/application/middleware_test.rb
@@ -76,7 +76,7 @@ module ApplicationTests
end
def middleware
- AppTemplate::Application.instance.middleware.active.map(&:klass).map(&:name)
+ AppTemplate::Application.middleware.active.map(&:klass).map(&:name)
end
end
end
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
diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb
index 4bfe210efb..0a79e2cfb8 100644
--- a/railties/test/generators/plugin_generator_test.rb
+++ b/railties/test/generators/plugin_generator_test.rb
@@ -17,11 +17,11 @@ class PluginGeneratorTest < Rails::Generators::TestCase
vendor/plugins/plugin_fu/uninstall.rb
vendor/plugins/plugin_fu/lib
vendor/plugins/plugin_fu/lib/plugin_fu.rb
+ vendor/plugins/plugin_fu/Rakefile
).each{ |path| assert_file path }
%w(
vendor/plugins/plugin_fu/README
- vendor/plugins/plugin_fu/Rakefile
).each{ |path| assert_file path, /PluginFu/ }
%w(