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

Changeset 7838

Show
Ignore:
Timestamp:
10/11/07 21:56:19 (1 year ago)
Author:
nzkoz
Message:

Backport fix to allow :controller=>:some_symbol [norbert]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1-2-stable/actionpack/lib/action_controller/assertions/response_assertions.rb

    r6471 r7838  
    7070 
    7171              if value.respond_to?(:[]) && value['controller'] 
     72                value['controller'] = value['controller'].to_s 
    7273                if key == :actual && value['controller'].first != '/' && !value['controller'].include?('/') 
    7374                  new_controller_path = ActionController::Routing.controller_relative_to(value['controller'], @controller.class.controller_path) 
  • branches/1-2-stable/actionpack/lib/action_controller/routing.rb

    r7834 r7838  
    12551255        expire_on = build_expiry(options, recall) 
    12561256 
     1257        if options[:controller] 
     1258          options[:controller] = options[:controller].to_s 
     1259        end 
    12571260        # if the controller has changed, make sure it changes relative to the 
    12581261        # current controller module, if any. In other words, if we're currently 
  • branches/1-2-stable/actionpack/test/controller/action_pack_assertions_test.rb

    r5788 r7838  
    1919 
    2020  def redirect_to_controller() redirect_to :controller => "elsewhere", :action => "flash_me"; end 
     21 
     22  def redirect_to_controller_with_symbol() redirect_to :controller => :elsewhere, :action => :flash_me; end 
    2123 
    2224  def redirect_to_path() redirect_to '/some/path' end 
     
    556558  end 
    557559 
     560  def test_assert_redirection_with_symbol 
     561    process :redirect_to_controller_with_symbol 
     562    assert_nothing_raised { 
     563      assert_redirected_to :controller => "elsewhere", :action => "flash_me" 
     564    } 
     565    process :redirect_to_controller_with_symbol 
     566    assert_nothing_raised { 
     567      assert_redirected_to :controller => :elsewhere, :action => :flash_me 
     568    } 
     569  end 
     570 
    558571  def test_redirected_to_with_nested_controller 
    559572    @controller = Admin::InnerModuleController.new 
  • branches/1-2-stable/actionpack/test/controller/url_rewriter_test.rb

    r7834 r7838  
    161161  end 
    162162 
     163  def test_path_generation_for_symbol_parameter_keys 
     164    assert_generates("/image", :controller=> :image) 
     165  end 
     166 
    163167  private 
    164168    def extract_params(url)