aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-12-12 23:55:14 +0000
committerRick Olson <technoweenie@gmail.com>2007-12-12 23:55:14 +0000
commitd98728e09132cfceea89436eb1a120cbe5a2219d (patch)
treec98360b4f5165ae9d5f81fe8f075cdf08486684f /activerecord/test
parent66e97c34c116bbf0e7b87802e81a9f7df0684b47 (diff)
downloadrails-d98728e09132cfceea89436eb1a120cbe5a2219d.tar.gz
rails-d98728e09132cfceea89436eb1a120cbe5a2219d.tar.bz2
rails-d98728e09132cfceea89436eb1a120cbe5a2219d.zip
Fix that validates_acceptance_of still works for non-existent tables (useful for bootstrapping new databases). Closes #10474 [hasmanyjosh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8377 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-xactiverecord/test/validations_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/validations_test.rb b/activerecord/test/validations_test.rb
index a694cbfe72..82b321a8c2 100755
--- a/activerecord/test/validations_test.rb
+++ b/activerecord/test/validations_test.rb
@@ -301,6 +301,14 @@ class ValidationsTest < Test::Unit::TestCase
assert_equal "Dan Brown", reply["author_name"]
end
+ def test_validates_acceptance_of_with_non_existant_table
+ Object.const_set :IncorporealModel, Class.new(ActiveRecord::Base)
+
+ assert_nothing_raised ActiveRecord::StatementInvalid do
+ IncorporealModel.validates_acceptance_of(:incorporeal_column)
+ end
+ end
+
def test_validate_presences
Topic.validates_presence_of(:title, :content)