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

Changeset 6055

Show
Ignore:
Timestamp:
01/28/07 07:00:43 (2 years ago)
Author:
bitsweat
Message:

Remove deprecated assertions.

Files:

Legend:

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

    r6054 r6055  
    11*SVN* 
     2 
     3* Remove deprecated assertions.  [Jeremy Kemper] 
    24 
    35* Change session restoration to allow namespaced models to be autoloaded. Closes #6348. [Nicholas Seckar] 
  • trunk/actionpack/lib/action_controller/assertions.rb

    r5020 r6055  
    5353        include ActionController::Assertions::DomAssertions 
    5454        include ActionController::Assertions::ModelAssertions 
    55         include ActionController::Assertions::DeprecatedAssertions 
    5655      end 
    5756    end 
     
    7271require File.dirname(__FILE__) + '/assertions/routing_assertions' 
    7372require File.dirname(__FILE__) + '/assertions/model_assertions' 
    74 require File.dirname(__FILE__) + '/assertions/deprecated_assertions' 
    7573 
    7674module Test #:nodoc: 
  • trunk/actionpack/test/controller/action_pack_assertions_test.rb

    r5785 r6055  
    174174    get :render_url 
    175175    assert_tag :content => "/action_pack_assertions/flash_me" 
    176   end 
    177  
    178   # test the session assertion to make sure something is there. 
    179   def test_assert_session_has 
    180     process :session_stuffing 
    181     assert_deprecated_assertion { assert_session_has 'xmas' } 
    182     assert_deprecated_assertion { assert_session_has_no 'halloween' } 
    183176  end 
    184177 
     
    210203#   end 
    211204 
    212   # test the assertion of goodies in the template 
    213   def test_assert_template_has 
    214     process :assign_this 
    215     assert_deprecated_assertion { assert_template_has 'howdy' } 
    216   end 
    217  
    218   # test the assertion for goodies that shouldn't exist in the template 
    219   def test_assert_template_has_no 
    220     process :nothing 
    221     assert_deprecated_assertion { assert_template_has_no 'maple syrup' } 
    222     assert_deprecated_assertion { assert_template_has_no 'howdy' } 
    223   end 
    224  
    225   # test the redirection assertions 
    226   def test_assert_redirect 
    227     process :redirect_internal 
    228     assert_deprecated_assertion { assert_redirect } 
    229   end 
    230  
    231   # test the redirect url string 
    232   def test_assert_redirect_url 
    233     process :redirect_external 
    234     assert_deprecated_assertion do 
    235       assert_redirect_url 'http://www.rubyonrails.org' 
    236     end 
    237   end 
    238  
    239   # test the redirection pattern matching on a string 
    240   def test_assert_redirect_url_match_string 
    241     process :redirect_external 
    242     assert_deprecated_assertion do 
    243       assert_redirect_url_match 'rails.org' 
    244     end 
    245   end 
    246  
    247   # test the redirection pattern matching on a pattern 
    248   def test_assert_redirect_url_match_pattern 
    249     process :redirect_external 
    250     assert_deprecated_assertion do 
    251       assert_redirect_url_match /ruby/ 
    252     end 
    253   end 
    254  
    255205  # test the redirection to a named route 
    256206  def test_assert_redirect_to_named_route 
     
    318268  end 
    319269 
    320   # test the flash-based assertions with something is in the flash 
    321   def test_flash_assertions_full 
    322     process :flash_me 
    323     assert @response.has_flash_with_contents? 
    324     assert_deprecated_assertion { assert_flash_exists } 
    325     assert_deprecated_assertion { assert_flash_not_empty } 
    326     assert_deprecated_assertion { assert_flash_has 'hello' } 
    327     assert_deprecated_assertion { assert_flash_has_no 'stds' } 
    328   end 
    329  
    330   # test the flash-based assertions with no flash at all 
    331   def test_flash_assertions_negative 
    332     process :nothing 
    333     assert_deprecated_assertion { assert_flash_empty } 
    334     assert_deprecated_assertion { assert_flash_has_no 'hello' } 
    335     assert_deprecated_assertion { assert_flash_has_no 'qwerty' } 
    336   end 
    337  
    338   # test the assert_rendered_file 
    339   def test_assert_rendered_file 
    340     assert_deprecated(/render/) { process :hello_world } 
    341     assert_deprecated_assertion { assert_rendered_file 'test/hello_world' } 
    342     assert_deprecated_assertion { assert_rendered_file 'hello_world' } 
    343   end 
    344  
    345   # test the assert_success assertion 
    346   def test_assert_success 
    347     process :nothing 
    348     assert_deprecated_assertion { assert_success } 
    349   end 
    350  
    351270  # -- standard request/response object testing -------------------------------- 
    352  
    353   # ensure our session is working properly 
    354   def test_session_objects 
    355     process :session_stuffing 
    356     assert @response.has_session_object?('xmas') 
    357     assert_deprecated_assertion { assert_session_equal 'turkey', 'xmas' } 
    358     assert !@response.has_session_object?('easter') 
    359   end 
    360271 
    361272  # make sure that the template objects exist 
     
    370281    process :nothing 
    371282    assert_nil @response.template_objects['howdy'] 
    372   end 
    373  
    374   def test_assigned_equal 
    375     process :assign_this 
    376     assert_deprecated_assertion { assert_assigned_equal "ho", :howdy } 
    377283  end 
    378284 
     
    398304    assert !@response.has_flash_with_contents? 
    399305    assert_nil @response.flash['hello'] 
    400   end 
    401  
    402   # examine that the flash objects are what we expect 
    403   def test_flash_equals 
    404     process :flash_me 
    405     assert_deprecated_assertion do 
    406       assert_flash_equal 'my name is inigo montoya...', 'hello' 
    407     end 
    408306  end 
    409307 
     
    490388  end 
    491389 
    492   def test_assert_template_xpath_match_no_matches 
    493     assert_deprecated(/render/) { process :hello_xml_world } 
    494     assert_raises Test::Unit::AssertionFailedError do 
    495       assert_deprecated_assertion do 
    496         assert_template_xpath_match('/no/such/node/in/document') 
    497       end 
    498     end 
    499   end 
    500  
    501   def test_simple_one_element_xpath_match 
    502     assert_deprecated(/render/) { process :hello_xml_world } 
    503     assert_deprecated_assertion do 
    504       assert_template_xpath_match('//title', "Hello World") 
    505     end 
    506   end 
    507  
    508   def test_array_of_elements_in_xpath_match 
    509     assert_deprecated(/render/) { process :hello_xml_world } 
    510     assert_deprecated_assertion do 
    511       assert_template_xpath_match('//p', %w( abes monks wiseguys )) 
    512     end 
    513   end 
    514  
    515390  def test_follow_redirect 
    516391    process :redirect_to_action 
     
    578453    end 
    579454  end 
    580  
    581   protected 
    582     def assert_deprecated_assertion(&block) 
    583       assert_deprecated(/assert/, &block) 
    584     end 
    585455end 
    586456