1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Make sure Metal use ActionController class name conventions [#2242 state:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
This commit is contained in:
Luca Guidi 2009-03-15 18:41:21 -05:00 committed by Joshua Peek
parent 7706b57034
commit 5f10533949
3 changed files with 12 additions and 1 deletions

View file

@ -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

View file

@ -0,0 +1,5 @@
class LegacyRoutes < Rails::Rack::Metal
def self.call(env)
[301, { "Location" => "http://example.com"}, nil]
end
end

View file

@ -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)