Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make sure Metal use ActionController class name conventions [#2242 st…

…ate:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information...
commit 5f10533949457e3797c8f0b51eb30a9268bceb4d 1 parent 7706b57
Luca Guidi authored josh committed
2  railties/lib/rails/rack/metal.rb
View
@@ -18,7 +18,7 @@ def self.metals
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
5 railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb
View
@@ -0,0 +1,5 @@
+class LegacyRoutes < Rails::Rack::Metal
+ def self.call(env)
+ [301, { "Location" => "http://example.com"}, nil]
+ end
+end
6 railties/test/metal_test.rb
View
@@ -8,6 +8,12 @@ def test_metals_should_return_list_of_found_metal_apps
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)
Please sign in to comment.
Something went wrong with that request. Please try again.