aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/routing_test.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index 2a014bf976..4808663aa9 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -245,7 +245,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
namespace :account do
match 'shorthand'
- match 'description', :to => "description", :as => "description"
+ match 'description', :to => :description, :as => "description"
+ match ':action/callback', :action => /twitter|github/, :to => "callbacks", :as => :callback
resource :subscription, :credit, :credit_card
root :to => "account#index"
@@ -1159,7 +1160,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
end
end
- def test_convention_match_with_no_scope
+ def test_match_shorthand_with_no_scope
with_test_routes do
assert_equal '/account/overview', account_overview_path
get '/account/overview'
@@ -1167,7 +1168,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
end
end
- def test_convention_match_inside_namespace
+ def test_match_shorthand_inside_namespace
with_test_routes do
assert_equal '/account/shorthand', account_shorthand_path
get '/account/shorthand'
@@ -1175,6 +1176,17 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
end
end
+ def test_scoped_controller_with_namespace_and_action
+ with_test_routes do
+ assert_equal '/account/twitter/callback', account_callback_path("twitter")
+ get '/account/twitter/callback'
+ assert_equal 'account/callbacks#twitter', @response.body
+
+ get '/account/whatever/callback'
+ assert_equal 'Not Found', @response.body
+ end
+ end
+
def test_convention_match_nested_and_with_leading_slash
with_test_routes do
assert_equal '/account/nested/overview', account_nested_overview_path