Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Apply [5607] to RC. References #6669.

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-pre-release@5608 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit ffa2c5fda50245c10e9adbee5b993fec10975e7c 1 parent 87ecb78
@seckar seckar authored
View
2  actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*1.13.0 RC1* (November 19th, 2006)
+* Update Routing to complain when :controller is not specified by a route. Closes #6669. [Nicholas Seckar]
+
* Ensure render_to_string cleans up after itself when an exception is raised. #6658 [rsanheim]
* Update to Prototype and script.aculo.us [5579]. [Sam Stephenson, Thomas Fuchs]
View
4 actionpack/lib/action_controller/routing.rb
@@ -950,6 +950,10 @@ def build(path, options)
route.significant_keys << :action
end
+ if !route.significant_keys.include?(:controller)
+ raise ArgumentError, "Illegal route: the :controller must be specified!"
+ end
+
route
end
end
View
6 actionpack/test/controller/routing_test.rb
@@ -853,6 +853,12 @@ def test_defaults
{ :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 }
View
4 actionpack/test/controller/url_rewriter_test.rb
@@ -78,7 +78,7 @@ def test_protocol
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 @@ def test_named_route
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
Please sign in to comment.
Something went wrong with that request. Please try again.