Skip to content
This repository
Browse code

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

…ate:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
commit 5f10533949457e3797c8f0b51eb30a9268bceb4d 1 parent 7706b57
authored March 15, 2009 josh committed March 15, 2009
2  railties/lib/rails/rack/metal.rb
@@ -18,7 +18,7 @@ def self.metals
18 18
         metal_glob.each do |glob|
19 19
           Dir[glob].sort.map do |file|
20 20
             file = file.match(matcher)[1]
21  
-            all_metals[file.classify] = file
  21
+            all_metals[file.camelize] = file
22 22
           end
23 23
         end
24 24
 
5  railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb
... ...
@@ -0,0 +1,5 @@
  1
+class LegacyRoutes < Rails::Rack::Metal
  2
+  def self.call(env)
  3
+    [301, { "Location" => "http://example.com"}, nil]
  4
+  end
  5
+end
6  railties/test/metal_test.rb
@@ -8,6 +8,12 @@ def test_metals_should_return_list_of_found_metal_apps
8 8
     end
9 9
   end
10 10
 
  11
+  def test_metals_should_respect_class_name_conventions
  12
+    use_appdir("pluralmetal") do
  13
+      assert_equal(["LegacyRoutes"], found_metals_as_string_array)
  14
+    end
  15
+  end
  16
+
11 17
   def test_metals_should_return_alphabetical_list_of_found_metal_apps
12 18
     use_appdir("multiplemetals") do
13 19
       assert_equal(["MetalA", "MetalB"], found_metals_as_string_array)

0 notes on commit 5f10533

Please sign in to comment.
Something went wrong with that request. Please try again.