diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-12-02 11:53:18 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-12-02 11:53:18 +0100 |
commit | 90e396ce65a563be90729de1f06a32535821bebb (patch) | |
tree | 75687611ca84080fce2acca61a233e55e81d6a84 /activerecord/test/cases/validations | |
parent | b8ec014b2d9f7cd740800a8a99839ad79f196bf8 (diff) | |
download | rails-90e396ce65a563be90729de1f06a32535821bebb.tar.gz rails-90e396ce65a563be90729de1f06a32535821bebb.tar.bz2 rails-90e396ce65a563be90729de1f06a32535821bebb.zip |
pg tests, move uniqueness validation test to array tests.
Diffstat (limited to 'activerecord/test/cases/validations')
-rw-r--r-- | activerecord/test/cases/validations/uniqueness_validation_test.rb | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/activerecord/test/cases/validations/uniqueness_validation_test.rb b/activerecord/test/cases/validations/uniqueness_validation_test.rb index c6b58d469d..524f59876e 100644 --- a/activerecord/test/cases/validations/uniqueness_validation_test.rb +++ b/activerecord/test/cases/validations/uniqueness_validation_test.rb @@ -30,11 +30,6 @@ class ReplyWithTitleObject < Reply def title; ReplyTitle.new; end end -class Employee < ActiveRecord::Base - self.table_name = 'postgresql_arrays' - validates_uniqueness_of :nicknames -end - class TopicWithUniqEvent < Topic belongs_to :event, foreign_key: :parent_id validates :event, uniqueness: true @@ -378,18 +373,6 @@ class UniquenessValidationTest < ActiveRecord::TestCase } end - if current_adapter? :PostgreSQLAdapter - def test_validate_uniqueness_with_array_column - e1 = Employee.create("nicknames" => ["john", "johnny"], "commission_by_quarter" => [1000, 1200]) - assert e1.persisted?, "Saving e1" - - e2 = Employee.create("nicknames" => ["john", "johnny"], "commission_by_quarter" => [2200]) - assert !e2.persisted?, "e2 shouldn't be valid" - assert e2.errors[:nicknames].any?, "Should have errors for nicknames" - assert_equal ["has already been taken"], e2.errors[:nicknames], "Should have uniqueness message for nicknames" - end - end - def test_validate_uniqueness_on_existing_relation event = Event.create assert TopicWithUniqEvent.create(event: event).valid? |