Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4649

Show
Ignore:
Timestamp:
08/01/06 21:34:58 (2 years ago)
Author:
minam
Message:

More tweaks to make sure assert_redirected_to works with symbols

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/assertions.rb

    r4648 r4649  
    8282            original.each do |key, value| 
    8383              if value.is_a?(Symbol) 
    84                 value = @controller.respond_to?(value, true) ? @controller.send(value) : @controller.send("hash_for_#{option}") 
    85               end 
     84                value = @controller.respond_to?(value, true) ? @controller.send(value) : @controller.send("hash_for_#{value}_url") 
     85              end 
     86 
    8687              unless value.is_a?(Hash) 
    8788                request = case value 
     
    9293                value = request.path_parameters if request 
    9394              end 
    94                
     95 
    9596              if value.is_a?(Hash) # stringify 2 levels of hash keys 
     97                if name = value.delete(:use_route) 
     98                  route = ActionController::Routing::Routes.named_routes[name] 
     99                  value.update(route.parameter_shell) 
     100                end 
     101 
    96102                value.stringify_keys! 
    97103                value.values.select { |v| v.is_a?(Hash) }.collect { |v| v.stringify_keys! }