aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-03-16 11:20:28 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-03-16 11:20:28 +0000
commitfc123d189c7394374af91a51efdcc756d3b11185 (patch)
treed0bc7c4760197a4abdea3b3f008a1615436acf54 /railties/test
parent6c688d000f7dc8a4e65d6730c7c425839d2583b4 (diff)
parent4185a4a5f5e53b55c9ba3757a837d33fb91f4091 (diff)
downloadrails-fc123d189c7394374af91a51efdcc756d3b11185.tar.gz
rails-fc123d189c7394374af91a51efdcc756d3b11185.tar.bz2
rails-fc123d189c7394374af91a51efdcc756d3b11185.zip
Merge commit 'mainstream/master'
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/fixtures/metal/multiplemetals/app/metal/metal_a.rb2
-rw-r--r--railties/test/fixtures/metal/multiplemetals/app/metal/metal_b.rb2
-rw-r--r--railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb5
-rw-r--r--railties/test/fixtures/metal/singlemetal/app/metal/foo_metal.rb2
-rw-r--r--railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_a.rb2
-rw-r--r--railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_b.rb2
-rw-r--r--railties/test/metal_test.rb6
7 files changed, 16 insertions, 5 deletions
diff --git a/railties/test/fixtures/metal/multiplemetals/app/metal/metal_a.rb b/railties/test/fixtures/metal/multiplemetals/app/metal/metal_a.rb
index b8e7001351..2d373ce422 100644
--- a/railties/test/fixtures/metal/multiplemetals/app/metal/metal_a.rb
+++ b/railties/test/fixtures/metal/multiplemetals/app/metal/metal_a.rb
@@ -1,5 +1,5 @@
class MetalA < Rails::Rack::Metal
def self.call(env)
- [200, { "Content-Type" => "text/html"}, "Hi"]
+ [200, { "Content-Type" => "text/html"}, ["Hi"]]
end
end
diff --git a/railties/test/fixtures/metal/multiplemetals/app/metal/metal_b.rb b/railties/test/fixtures/metal/multiplemetals/app/metal/metal_b.rb
index adc2f45fcf..a8bbf3fd60 100644
--- a/railties/test/fixtures/metal/multiplemetals/app/metal/metal_b.rb
+++ b/railties/test/fixtures/metal/multiplemetals/app/metal/metal_b.rb
@@ -1,5 +1,5 @@
class MetalB < Rails::Rack::Metal
def self.call(env)
- [200, { "Content-Type" => "text/html"}, "Hi"]
+ [200, { "Content-Type" => "text/html"}, ["Hi"]]
end
end
diff --git a/railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb b/railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb
new file mode 100644
index 0000000000..0cd3737c32
--- /dev/null
+++ b/railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb
@@ -0,0 +1,5 @@
+class LegacyRoutes < Rails::Rack::Metal
+ def self.call(env)
+ [301, { "Location" => "http://example.com"}, []]
+ end
+end
diff --git a/railties/test/fixtures/metal/singlemetal/app/metal/foo_metal.rb b/railties/test/fixtures/metal/singlemetal/app/metal/foo_metal.rb
index 9ade2ce8e7..5f5b087592 100644
--- a/railties/test/fixtures/metal/singlemetal/app/metal/foo_metal.rb
+++ b/railties/test/fixtures/metal/singlemetal/app/metal/foo_metal.rb
@@ -1,5 +1,5 @@
class FooMetal < Rails::Rack::Metal
def self.call(env)
- [200, { "Content-Type" => "text/html"}, "Hi"]
+ [200, { "Content-Type" => "text/html"}, ["Hi"]]
end
end
diff --git a/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_a.rb b/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_a.rb
index 71a5a62eb8..25b3bb0abc 100644
--- a/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_a.rb
+++ b/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_a.rb
@@ -1,7 +1,7 @@
module Folder
class MetalA < Rails::Rack::Metal
def self.call(env)
- [200, { "Content-Type" => "text/html"}, "Hi"]
+ [200, { "Content-Type" => "text/html"}, ["Hi"]]
end
end
end
diff --git a/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_b.rb b/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_b.rb
index 430d7bfed6..7583363f71 100644
--- a/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_b.rb
+++ b/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_b.rb
@@ -1,7 +1,7 @@
module Folder
class MetalB < Rails::Rack::Metal
def self.call(env)
- [200, { "Content-Type" => "text/html"}, "Hi"]
+ [200, { "Content-Type" => "text/html"}, ["Hi"]]
end
end
end
diff --git a/railties/test/metal_test.rb b/railties/test/metal_test.rb
index 143efdda11..d3d231132b 100644
--- a/railties/test/metal_test.rb
+++ b/railties/test/metal_test.rb
@@ -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)