Permalink
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...
1 parent 7706b57 commit 5f10533949457e3797c8f0b51eb30a9268bceb4d Luca Guidi committed with josh Mar 15, 2009
@@ -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
@@ -0,0 +1,5 @@
+class LegacyRoutes < Rails::Rack::Metal
+ def self.call(env)
+ [301, { "Location" => "http://example.com"}, nil]
+ end
+end
@@ -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)

0 comments on commit 5f10533

Please sign in to comment.