Skip to content
Browse files

rack bodies should be a list

  • Loading branch information...
1 parent 585e291 commit 2bc3f81c89c1cd7444d476411bef626173172dc0 @tenderlove tenderlove committed Dec 22, 2011
Showing with 7 additions and 7 deletions.
  1. +7 −7 actionpack/test/controller/routing_test.rb
View
14 actionpack/test/controller/routing_test.rb
@@ -90,16 +90,16 @@ def get(uri_or_host, path = nil, port = nil)
'REQUEST_METHOD' => 'GET',
'HTTP_HOST' => host}
- @rs.call(params)[2]
+ @rs.call(params)[2].join
end
def test_regexp_precidence
@rs.draw do
match '/whois/:domain', :constraints => {
:domain => /\w+\.[\w\.]+/ },
- :to => lambda { |env| [200, {}, 'regexp'] }
+ :to => lambda { |env| [200, {}, %w{regexp}] }
- match '/whois/:id', :to => lambda { |env| [200, {}, 'id'] }
+ match '/whois/:id', :to => lambda { |env| [200, {}, %w{id}] }
end
assert_equal 'regexp', get(URI('http://example.org/whois/example.org'))
@@ -115,9 +115,9 @@ def matches? request
@rs.draw do
match '/', :constraints => subdomain.new,
- :to => lambda { |env| [200, {}, 'default'] }
+ :to => lambda { |env| [200, {}, %w{default}] }
match '/', :constraints => { :subdomain => 'clients' },
- :to => lambda { |env| [200, {}, 'clients'] }
+ :to => lambda { |env| [200, {}, %w{clients}] }
end
assert_equal 'default', get(URI('http://www.example.org/'))
@@ -128,11 +128,11 @@ def test_lambda_constraints
@rs.draw do
match '/', :constraints => lambda { |req|
req.subdomain.present? and req.subdomain != "clients" },
- :to => lambda { |env| [200, {}, 'default'] }
+ :to => lambda { |env| [200, {}, %w{default}] }
match '/', :constraints => lambda { |req|
req.subdomain.present? && req.subdomain == "clients" },
- :to => lambda { |env| [200, {}, 'clients'] }
+ :to => lambda { |env| [200, {}, %w{clients}] }
end
assert_equal 'default', get(URI('http://www.example.org/'))

0 comments on commit 2bc3f81

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