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:
parent
7706b57034
commit
5f10533949
3 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
5
railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb
vendored
Normal file
5
railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb
vendored
Normal file
|
@ -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 @@ 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)
|
||||
|
|
Loading…
Reference in a new issue