diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-28 07:00:43 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-28 07:00:43 +0000 |
commit | dde527440a52317e2e7eb4a928009c036cdf772b (patch) | |
tree | 38d2074137aebb8f89911576f05d48e639f21d07 /actionpack/test/activerecord | |
parent | b7df9162492383e2186762d85586b27ca120a1dd (diff) | |
download | rails-dde527440a52317e2e7eb4a928009c036cdf772b.tar.gz rails-dde527440a52317e2e7eb4a928009c036cdf772b.tar.bz2 rails-dde527440a52317e2e7eb4a928009c036cdf772b.zip |
Remove deprecated assertions.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6055 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/activerecord')
-rw-r--r-- | actionpack/test/activerecord/active_record_assertions_test.rb | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/actionpack/test/activerecord/active_record_assertions_test.rb b/actionpack/test/activerecord/active_record_assertions_test.rb deleted file mode 100644 index 9a3c1127a2..0000000000 --- a/actionpack/test/activerecord/active_record_assertions_test.rb +++ /dev/null @@ -1,92 +0,0 @@ -require "#{File.dirname(__FILE__)}/../active_record_unit" - -class ActiveRecordAssertionsController < ActionController::Base - self.template_root = "#{File.dirname(__FILE__)}/../fixtures/" - - # fail with 1 bad column - def nasty_columns_1 - @company = Company.new - @company.name = "B" - @company.rating = 2 - render :inline => "snicker...." - end - - # fail with 2 bad columns - def nasty_columns_2 - @company = Company.new - @company.name = "" - @company.rating = 2 - render :inline => "double snicker...." - end - - # this will pass validation - def good_company - @company = Company.new - @company.name = "A" - @company.rating = 69 - render :inline => "Goodness Gracious!" - end - - # this will fail validation - def bad_company - @company = Company.new - render :inline => "Who's Bad?" - end - - # the safety dance...... - def rescue_action(e) raise; end -end - -class ActiveRecordAssertionsControllerTest < ActiveRecordTestCase - fixtures :companies - - def setup - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @controller = ActiveRecordAssertionsController.new - super - end - - # test for 1 bad apple column - def test_some_invalid_columns - process :nasty_columns_1 - 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_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_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_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 |