public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
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
Nicholas Seckar (author)
Wed Nov 22 08:38:06 -0800 2006
commit  ffa2c5fda50245c10e9adbee5b993fec10975e7c
tree    58c5109fdefd64fb5302b4ad019e9c42604c7765
parent  87ecb782e6613f93790cd258eff65425128f2bad
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *1.13.0 RC1* (November 19th, 2006)
0
 
0
+* Update Routing to complain when :controller is not specified by a route. Closes #6669. [Nicholas Seckar]
0
+
0
 * Ensure render_to_string cleans up after itself when an exception is raised. #6658 [rsanheim]
0
 
0
 * Update to Prototype and script.aculo.us [5579]. [Sam Stephenson, Thomas Fuchs]
...
950
951
952
 
 
 
 
953
954
955
...
950
951
952
953
954
955
956
957
958
959
0
@@ -950,6 +950,10 @@
0
           route.significant_keys << :action
0
         end
0
 
0
+ if !route.significant_keys.include?(:controller)
0
+ raise ArgumentError, "Illegal route: the :controller must be specified!"
0
+ end
0
+
0
         route
0
       end
0
     end
...
853
854
855
 
 
 
 
 
 
856
857
858
...
853
854
855
856
857
858
859
860
861
862
863
864
0
@@ -853,6 +853,12 @@
0
       { :controller => "users", :action => "show", :format => "html" },
0
       route.defaults)
0
   end
0
+
0
+ def test_builder_complains_without_controller
0
+ assert_raises(ArgumentError) do
0
+ ROUTING::RouteBuilder.new.build '/contact', :contoller => "contact", :action => "index"
0
+ end
0
+ end
0
 
0
   def test_significant_keys_for_default_route
0
     keys = default_route.significant_keys.sort_by {|k| k.to_s }
...
78
79
80
81
 
82
83
84
...
96
97
98
99
 
100
101
102
...
78
79
80
 
81
82
83
84
...
96
97
98
 
99
100
101
102
0
@@ -78,7 +78,7 @@
0
   
0
   def test_named_route
0
     ActionController::Routing::Routes.draw do |map|
0
- map.home '/home/sweet/home/:user''
0
+ map.home '/home/sweet/home/:user', :controller => 'home', :action => 'index'
0
       map.connect ':controller/:action/:id'
0
     end
0
     
0
@@ -96,7 +96,7 @@
0
   
0
   def test_only_path
0
     ActionController::Routing::Routes.draw do |map|
0
- map.home '/home/sweet/home/:user''
0
+ map.home '/home/sweet/home/:user', :controller => 'home', :action => 'index'
0
       map.connect ':controller/:action/:id'
0
     end
0
     

Comments

    No one has commented yet.