diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-04 03:07:17 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-04 03:07:17 +0000 |
commit | c3a52523ceaf4aab819c7c5da748d552f9cb3f99 (patch) | |
tree | 18d27610f2e5084f62a3bd7c6d3ef1bcaaa9a800 /actionpack/test | |
parent | 23d579b262e6f665d8d343d066aa7fd640ce46b4 (diff) | |
download | rails-c3a52523ceaf4aab819c7c5da748d552f9cb3f99.tar.gz rails-c3a52523ceaf4aab819c7c5da748d552f9cb3f99.tar.bz2 rails-c3a52523ceaf4aab819c7c5da748d552f9cb3f99.zip |
Active Record integration deprecation tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4962 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/activerecord/active_record_assertions_test.rb | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/actionpack/test/activerecord/active_record_assertions_test.rb b/actionpack/test/activerecord/active_record_assertions_test.rb index 6662d3d10c..9a3c1127a2 100644 --- a/actionpack/test/activerecord/active_record_assertions_test.rb +++ b/actionpack/test/activerecord/active_record_assertions_test.rb @@ -50,34 +50,43 @@ class ActiveRecordAssertionsControllerTest < ActiveRecordTestCase # test for 1 bad apple column def test_some_invalid_columns process :nasty_columns_1 - assert_success - assert_invalid_record 'company' - assert_invalid_column_on_record 'company', 'rating' - assert_valid_column_on_record 'company', 'name' - assert_valid_column_on_record 'company', %w(name id) + assert_response :success + + assert_deprecated_assertion { assert_invalid_record 'company' } + assert_deprecated_assertion { assert_invalid_column_on_record 'company', 'rating' } + assert_deprecated_assertion { assert_valid_column_on_record 'company', 'name' } + assert_deprecated_assertion { assert_valid_column_on_record 'company', %w(name id) } end # test for 2 bad apples columns def test_all_invalid_columns process :nasty_columns_2 - assert_success - assert_invalid_record 'company' - assert_invalid_column_on_record 'company', 'rating' - assert_invalid_column_on_record 'company', 'name' - assert_invalid_column_on_record 'company', %w(name rating) + assert_response :success + + assert_deprecated_assertion { assert_invalid_record 'company' } + assert_deprecated_assertion { assert_invalid_column_on_record 'company', 'rating' } + assert_deprecated_assertion { assert_invalid_column_on_record 'company', 'name' } + assert_deprecated_assertion { assert_invalid_column_on_record 'company', %w(name rating) } end # ensure we have no problems with an ActiveRecord def test_valid_record process :good_company - assert_success - assert_valid_record 'company' + assert_response :success + + assert_deprecated_assertion { assert_valid_record 'company' } end # ensure we have problems with an ActiveRecord def test_invalid_record process :bad_company - assert_success - assert_invalid_record 'company' + assert_response :success + + assert_deprecated_assertion { assert_invalid_record 'company' } end + + protected + def assert_deprecated_assertion(message = nil, &block) + assert_deprecated(/assert_.*from test_/, &block) + end end |