aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Guidi <guidi.luca@gmail.com>2009-03-15 18:41:21 -0500
committerJoshua Peek <josh@joshpeek.com>2009-03-15 18:41:21 -0500
commit5f10533949457e3797c8f0b51eb30a9268bceb4d (patch)
tree791f3df5d1c43ea68a814140271db4193e767de0
parent7706b57034e91820cf83445aede57c54ab66ac2d (diff)
downloadrails-5f10533949457e3797c8f0b51eb30a9268bceb4d.tar.gz
rails-5f10533949457e3797c8f0b51eb30a9268bceb4d.tar.bz2
rails-5f10533949457e3797c8f0b51eb30a9268bceb4d.zip
Make sure Metal use ActionController class name conventions [#2242 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
-rw-r--r--railties/lib/rails/rack/metal.rb2
-rw-r--r--railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb5
-rw-r--r--railties/test/metal_test.rb6
3 files changed, 12 insertions, 1 deletions
diff --git a/railties/lib/rails/rack/metal.rb b/railties/lib/rails/rack/metal.rb
index 78b8a01449..adc43da864 100644
--- a/railties/lib/rails/rack/metal.rb
+++ b/railties/lib/rails/rack/metal.rb
@@ -18,7 +18,7 @@ module Rails
metal_glob.each do |glob|
Dir[glob].sort.map do |file|
file = file.match(matcher)[1]
- all_metals[file.classify] = file
+ all_metals[file.camelize] = file
end
end
diff --git a/railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb b/railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb
new file mode 100644
index 0000000000..6f9e382500
--- /dev/null
+++ b/railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb
@@ -0,0 +1,5 @@
+class LegacyRoutes < Rails::Rack::Metal
+ def self.call(env)
+ [301, { "Location" => "http://example.com"}, nil]
+ end
+end
diff --git a/railties/test/metal_test.rb b/railties/test/metal_test.rb
index 143efdda11..d3d231132b 100644
--- a/railties/test/metal_test.rb
+++ b/railties/test/metal_test.rb
@@ -8,6 +8,12 @@ class MetalTest < Test::Unit::TestCase
end
end
+ def test_metals_should_respect_class_name_conventions
+ use_appdir("pluralmetal") do
+ assert_equal(["LegacyRoutes"], found_metals_as_string_array)
+ end
+ end
+
def test_metals_should_return_alphabetical_list_of_found_metal_apps
use_appdir("multiplemetals") do
assert_equal(["MetalA", "MetalB"], found_metals_as_string_array)