aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2006-11-22 16:31:00 +0000
committerNicholas Seckar <nseckar@gmail.com>2006-11-22 16:31:00 +0000
commitd1529a71d120a8533f7e042b8e92698428c7a3a1 (patch)
tree0d5453e026d1fe77b7c8d37313a3ebe2681c1a88 /actionpack/test
parenta2e826dc0f32647d8e4ae68214d717a5f3fc15df (diff)
downloadrails-d1529a71d120a8533f7e042b8e92698428c7a3a1.tar.gz
rails-d1529a71d120a8533f7e042b8e92698428c7a3a1.tar.bz2
rails-d1529a71d120a8533f7e042b8e92698428c7a3a1.zip
Update Routing to complain when :controller is not specified by a route. Closes #6669.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5607 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/routing_test.rb6
-rw-r--r--actionpack/test/controller/url_rewriter_test.rb4
2 files changed, 8 insertions, 2 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index cfba8fb976..18fcef5bc5 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -853,6 +853,12 @@ class RouteTest < Test::Unit::TestCase
{ :controller => "users", :action => "show", :format => "html" },
route.defaults)
end
+
+ def test_builder_complains_without_controller
+ assert_raises(ArgumentError) do
+ ROUTING::RouteBuilder.new.build '/contact', :contoller => "contact", :action => "index"
+ end
+ end
def test_significant_keys_for_default_route
keys = default_route.significant_keys.sort_by {|k| k.to_s }
diff --git a/actionpack/test/controller/url_rewriter_test.rb b/actionpack/test/controller/url_rewriter_test.rb
index 53cd278b6b..882add496f 100644
--- a/actionpack/test/controller/url_rewriter_test.rb
+++ b/actionpack/test/controller/url_rewriter_test.rb
@@ -78,7 +78,7 @@ class UrlWriterTests < Test::Unit::TestCase
def test_named_route
ActionController::Routing::Routes.draw do |map|
- map.home '/home/sweet/home/:user'
+ map.home '/home/sweet/home/:user', :controller => 'home', :action => 'index'
map.connect ':controller/:action/:id'
end
@@ -96,7 +96,7 @@ class UrlWriterTests < Test::Unit::TestCase
def test_only_path
ActionController::Routing::Routes.draw do |map|
- map.home '/home/sweet/home/:user'
+ map.home '/home/sweet/home/:user', :controller => 'home', :action => 'index'
map.connect ':controller/:action/:id'
end