aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/response_test.rb4
-rw-r--r--actionpack/test/dispatch/routing_test.rb24
2 files changed, 24 insertions, 4 deletions
diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb
index 59ad2e48bd..02f63f7006 100644
--- a/actionpack/test/dispatch/response_test.rb
+++ b/actionpack/test/dispatch/response_test.rb
@@ -178,7 +178,7 @@ class ResponseIntegrationTest < ActionDispatch::IntegrationTest
@app = lambda { |env|
[200,
{'ETag' => '"202cb962ac59075b964b07152d234b70"',
- 'Cache-Control' => 'public'}, 'Hello']
+ 'Cache-Control' => 'public'}, ['Hello']]
}
get '/'
@@ -217,7 +217,7 @@ class ResponseIntegrationTest < ActionDispatch::IntegrationTest
@app = lambda { |env|
[200,
{'Content-Type' => 'application/xml; charset=utf-16'},
- 'Hello']
+ ['Hello']]
}
get '/'
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index 1c7822358d..360ffe977b 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -22,7 +22,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
delete 'logout', :to => :destroy, :as => :logout
end
- match 'account/logout' => redirect("/logout")
+ match 'account/logout' => redirect("/logout"), :as => :logout_redirect
match 'account/login', :to => redirect("/login")
match 'account/modulo/:name', :to => redirect("/%{name}s")
@@ -109,7 +109,9 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
scope ':access_token', :constraints => { :access_token => /\w{5,5}/ } do
resources :rooms
end
-
+
+ match '/info' => 'projects#info', :as => 'info'
+
root :to => 'projects#index'
end
end
@@ -153,6 +155,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
def test_logout_redirect_without_to
with_test_routes do
+ assert_equal '/account/logout', logout_redirect_path
get '/account/logout'
assert_equal 301, @response.status
assert_equal 'http://www.example.com/logout', @response.headers['Location']
@@ -462,10 +465,27 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
def test_root
with_test_routes do
+ assert_equal '/', root_path
get '/'
assert_equal 'projects#index', @response.body
end
end
+
+ def test_index
+ with_test_routes do
+ assert_equal '/info', info_path
+ get '/info'
+ assert_equal 'projects#info', @response.body
+ end
+ end
+
+ def test_index
+ with_test_routes do
+ assert_equal '/info', info_path
+ get '/info'
+ assert_equal 'projects#info', @response.body
+ end
+ end
private
def with_test_routes