aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/validations_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-01-05 14:58:28 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2008-01-05 14:58:28 +0000
commitebe3a0d532152d47f270ffaa0e11b994f4a8b177 (patch)
treed25ff07781cc30994316e9e34378ffea8725cf00 /activerecord/test/validations_test.rb
parent139b92495fa7697cdd619c549d4c7b263562b761 (diff)
downloadrails-ebe3a0d532152d47f270ffaa0e11b994f4a8b177.tar.gz
rails-ebe3a0d532152d47f270ffaa0e11b994f4a8b177.tar.bz2
rails-ebe3a0d532152d47f270ffaa0e11b994f4a8b177.zip
More thoroughly quote table names. Exposes some issues with sqlite2 adapter. Closes #10698.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/validations_test.rb')
-rwxr-xr-xactiverecord/test/validations_test.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/activerecord/test/validations_test.rb b/activerecord/test/validations_test.rb
index c4f6f2d6b1..daec199be1 100755
--- a/activerecord/test/validations_test.rb
+++ b/activerecord/test/validations_test.rb
@@ -3,6 +3,7 @@ require 'fixtures/topic'
require 'fixtures/reply'
require 'fixtures/person'
require 'fixtures/developer'
+require 'fixtures/warehouse_thing'
# The following methods in Topic are used in test_conditional_validation_*
class Topic
@@ -54,7 +55,7 @@ class Thaumaturgist < IneptWizard
end
class ValidationsTest < ActiveSupport::TestCase
- fixtures :topics, :developers
+ fixtures :topics, :developers, 'warehouse-things'
def setup
Topic.write_inheritable_attribute(:validate, nil)
@@ -435,6 +436,13 @@ class ValidationsTest < ActiveSupport::TestCase
assert t2.save, "should save with nil"
end
+ def test_validate_uniqueness_with_non_standard_table_names
+ i1 = WarehouseThing.create(:value => 1000)
+ assert !i1.valid?, "i1 should not be valid"
+ assert i1.errors.on(:value), "Should not be empty"
+ end
+
+
def test_validate_straight_inheritance_uniqueness
w1 = IneptWizard.create(:name => "Rincewind", :city => "Ankh-Morpork")
assert w1.valid?, "Saving w1"