public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/josh/rails.git
Heckling ActionController::Resources::Resource revealed that set_prefixes 
didn't break when :name_prefix was munged. #7081 [Kevin Clark]

git-svn-id: 
http://svn-commit.rubyonrails.org/rails/branches/1-2-pre-release@5975 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
technoweenie (author)
Tue Jan 16 22:47:51 -0800 2007
commit  e9e86fd134e363c487cb8501fbebe7881bcf422a
tree    50355bd28c5b328a9fc1c4f10c6dbbbb5ba74913
parent  81b94c2f106f615eaca40b14e1c6ef150a56319c
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *1.13.0* (January 16th, 2007)
0
 
0
+* Heckling ActionController::Resources::Resource revealed that set_prefixes didn't break when :name_prefix was munged. #7081 [Kevin Clark]
0
+
0
 * Update to Prototype 1.5.0. [Sam Stephenson]
0
 
0
 * Allow exempt_from_layout :rhtml. #6742, #7026 [dcmanges, Squeegy]
...
49
50
51
 
 
 
 
 
 
52
53
54
...
232
233
234
235
236
237
238
239
240
241
 
 
 
 
 
 
 
 
242
243
244
...
49
50
51
52
53
54
55
56
57
58
59
60
...
238
239
240
 
 
 
 
 
 
 
241
242
243
244
245
246
247
248
249
250
251
0
@@ -49,6 +49,12 @@ class ResourcesTest < Test::Unit::TestCase
0
       assert_simply_restful_for :comments, :path_prefix => 'thread/5/', :options => { :thread_id => '5' }
0
     end
0
   end
0
+
0
+ def test_with_name_prefix
0
+ with_restful_routing :messages, :name_prefix => 'post_' do
0
+ assert_simply_restful_for :messages, :name_prefix => 'post_'
0
+ end
0
+ end
0
 
0
   def test_with_collection_action
0
     rss_options = {:action => 'rss'}
0
@@ -232,13 +238,14 @@ class ResourcesTest < Test::Unit::TestCase
0
       options[:options].delete :action
0
 
0
       full_prefix = "/#{options[:path_prefix]}#{controller_name}"
0
-
0
- assert_named_route "#{full_prefix}", "#{controller_name}_path", options[:options]
0
- assert_named_route "#{full_prefix}.xml", "formatted_#{controller_name}_path", options[:options].merge(:format => 'xml')
0
- assert_named_route "#{full_prefix}/new", "new_#{singular_name}_path", options[:options]
0
- assert_named_route "#{full_prefix}/1", "#{singular_name}_path", options[:options].merge(:id => '1')
0
- assert_named_route "#{full_prefix}/1;edit", "edit_#{singular_name}_path", options[:options].merge(:id => '1')
0
- assert_named_route "#{full_prefix}/1.xml", "formatted_#{singular_name}_path", options[:options].merge(:format => 'xml', :id => '1')
0
+ name_prefix = options[:name_prefix]
0
+
0
+ assert_named_route "#{full_prefix}", "#{name_prefix}#{controller_name}_path", options[:options]
0
+ assert_named_route "#{full_prefix}.xml", "formatted_#{name_prefix}#{controller_name}_path", options[:options].merge(:format => 'xml')
0
+ assert_named_route "#{full_prefix}/new", "#{name_prefix}new_#{singular_name}_path", options[:options]
0
+ assert_named_route "#{full_prefix}/1", "#{name_prefix}#{singular_name}_path", options[:options].merge(:id => '1')
0
+ assert_named_route "#{full_prefix}/1;edit", "#{name_prefix}edit_#{singular_name}_path", options[:options].merge(:id => '1')
0
+ assert_named_route "#{full_prefix}/1.xml", "formatted_#{name_prefix}#{singular_name}_path", options[:options].merge(:format => 'xml', :id => '1')
0
       yield options[:options] if block_given?
0
     end
0
 

Comments

    No one has commented yet.