aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-07 12:18:33 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-07 12:18:33 +0000
commit465e0c0c2635588927ca707e6220cd7f232b3f17 (patch)
tree20ebc94d46285290708737ce56bbb7bc1c3a26c4 /actionpack/test/controller
parent1e4a936bd08f330062fedf2a32110f23ade0a322 (diff)
downloadrails-465e0c0c2635588927ca707e6220cd7f232b3f17.tar.gz
rails-465e0c0c2635588927ca707e6220cd7f232b3f17.tar.bz2
rails-465e0c0c2635588927ca707e6220cd7f232b3f17.zip
Added the possibility of having validate be protected for assert_(in)valid_column #263 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@67 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/active_record_assertions_test.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/actionpack/test/controller/active_record_assertions_test.rb b/actionpack/test/controller/active_record_assertions_test.rb
index 53106aaee7..2a005b8586 100644
--- a/actionpack/test/controller/active_record_assertions_test.rb
+++ b/actionpack/test/controller/active_record_assertions_test.rb
@@ -21,11 +21,12 @@ require 'fixtures/company'
# add some validation rules to trip up the assertions
class Company
- def validate
- errors.add_on_empty('name')
- errors.add('rating', 'rating should not be 2') if rating == 2
- errors.add_to_base('oh oh') if rating == 3
- end
+ protected
+ def validate
+ errors.add_on_empty('name')
+ errors.add('rating', 'rating should not be 2') if rating == 2
+ errors.add_to_base('oh oh') if rating == 3
+ end
end
# -----------------------------------------------------------------------------