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

Changeset 1251

Show
Ignore:
Timestamp:
04/30/05 08:34:02 (3 years ago)
Author:
david
Message:

Fixed assert_redirected_to to work with :only_path => false #1204 [Alisdair McDiarmid]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r1249 r1251  
    11*SVN* 
     2 
     3* Fixed assert_redirected_to to work with :only_path => false #1204 [Alisdair McDiarmid] 
    24 
    35* Fixed render_partial_collection to output an empty string instead of nil when handed an empty array #1202 [Ryan Carver] 
  • trunk/actionpack/lib/action_controller/assertions.rb

    r1223 r1251  
    5858          else 
    5959            options.keys.all? do |k|  
    60               options[k] == (@response.redirected_to[k].respond_to?(:to_param) ? @response.redirected_to[k].to_param : @response.redirected_to[k] if @response.redirected_to[k]
     60              options[k] == (@response.redirected_to[k].respond_to?(:to_param) ? @response.redirected_to[k].to_param : @response.redirected_to[k] unless @response.redirected_to[k].nil?
    6161            end 
    6262          end 
  • trunk/actionpack/test/controller/redirect_test.rb

    r786 r1251  
    1010  end 
    1111   
     12  def host_redirect 
     13    redirect_to :action => "other_host", :only_path => false, :host => 'other.test.host' 
     14  end 
     15 
    1216  def rescue_errors(e) raise e end 
    1317   
     
    3438    assert_redirect_url "http://test.host/redirect/dashboard/1?message=hello" 
    3539  end 
     40 
     41  def test_simple_redirect_using_options 
     42    get :host_redirect 
     43    assert_redirected_to :action => "other_host", :only_path => false, :host => 'other.test.host' 
     44  end 
    3645end