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

Changeset 4451

Show
Ignore:
Timestamp:
06/16/06 03:22:09 (2 years ago)
Author:
rick
Message:

add passing test to make sure unhandled requests don't load unnecessary classes. Closed #5408. [nkriege@hotmail.com]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/test/controller/routing_test.rb

    r4444 r4451  
    843843 
    844844  def test_simple_build_query_string 
    845     assert_equal '?x=1&y=2', @route.build_query_string(:x => '1', :y => '2'
     845    assert_equal '?x=1&y=2', order_query_string(@route.build_query_string(:x => '1', :y => '2')
    846846  end 
    847847 
    848848  def test_convert_ints_build_query_string 
    849     assert_equal '?x=1&y=2', @route.build_query_string(:x => 1, :y => 2
     849    assert_equal '?x=1&y=2', order_query_string(@route.build_query_string(:x => 1, :y => 2)
    850850  end 
    851851 
    852852  def test_escape_spaces_build_query_string 
    853     assert_equal '?x=hello+world&y=goodbye+world', @route.build_query_string(:x => 'hello world', :y => 'goodbye world'
     853    assert_equal '?x=hello+world&y=goodbye+world', order_query_string(@route.build_query_string(:x => 'hello world', :y => 'goodbye world')
    854854  end 
    855855 
    856856  def test_expand_array_build_query_string 
    857     assert_equal '?x[]=1&x[]=2', @route.build_query_string(:x => [1, 2]
     857    assert_equal '?x[]=1&x[]=2', order_query_string(@route.build_query_string(:x => [1, 2])
    858858  end 
    859859 
    860860  def test_escape_spaces_build_query_string_selected_keys 
    861     assert_equal '?x=hello+world', @route.build_query_string({:x => 'hello world', :y => 'goodbye world'}, [:x]) 
    862   end 
     861    assert_equal '?x=hello+world', order_query_string(@route.build_query_string({:x => 'hello world', :y => 'goodbye world'}, [:x])) 
     862  end 
     863   
     864  private 
     865    def order_query_string(qs) 
     866      '?' + qs[1..-1].split('&').sort.join('&') 
     867    end 
    863868end 
    864869 
     
    13021307  end 
    13031308 
     1309  def test_routing_traversal_does_not_load_extra_classes 
     1310    assert !Object.const_defined?("Profiler__"), "Profiler should not be loaded" 
     1311    set.draw do |map| 
     1312      map.connect '/profile', :controller => 'profile' 
     1313    end 
     1314 
     1315    request.path = '/profile' 
     1316 
     1317    set.recognize(request) rescue nil 
     1318     
     1319    assert !Object.const_defined?("Profiler__"), "Profiler should not be loaded" 
     1320  end 
    13041321 
    13051322  def test_recognize_with_conditions_and_format