Changeset 4444
- Timestamp:
- 06/07/06 16:27:14 (3 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/routing.rb (modified) (1 diff)
- trunk/actionpack/test/controller/routing_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r4438 r4444 1 1 *SVN* 2 3 * Make sure passed routing options are not mutated by routing code. #5314 [Blair Zajac] 2 4 3 5 * Make sure changing the controller from foo/bar to bing/bang does not change relative to foo. [Jamis Buck] trunk/actionpack/lib/action_controller/routing.rb
r4443 r4444 671 671 # and requirements. 672 672 def divide_route_options(segments, options) 673 requirements = options.delete(:requirements) || {} 674 defaults = options.delete(:defaults) || {} 675 conditions = options.delete(:conditions) || {} 673 options = options.dup 674 requirements = (options.delete(:requirements) || {}).dup 675 defaults = (options.delete(:defaults) || {}).dup 676 conditions = (options.delete(:conditions) || {}).dup 676 677 677 678 path_keys = segments.collect { |segment| segment.key if segment.respond_to?(:key) }.compact trunk/actionpack/test/controller/routing_test.rb
r4443 r4444 864 864 865 865 class RouteBuilderTest < Test::Unit::TestCase 866 866 867 867 def builder 868 @bulider ||= ROUTING::RouteBuilder.new 869 end 870 868 @builder ||= ROUTING::RouteBuilder.new 869 end 870 871 def build(path, options) 872 builder.build(path, options) 873 end 874 875 def test_options_should_not_be_modified 876 requirements1 = { :id => /\w+/, :controller => /(?:[a-z](?:-?[a-z]+)*)/ } 877 requirements2 = requirements1.dup 878 879 assert_equal requirements1, requirements2 880 881 with_options(:controller => 'folder', 882 :requirements => requirements2) do |m| 883 m.build 'folders/new', :action => 'new' 884 end 885 886 assert_equal requirements1, requirements2 887 end 888 871 889 def test_segment_for_static 872 890 segment, rest = builder.segment_for 'ulysses'