diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-11-08 13:57:51 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-11-08 13:59:07 -0200 |
commit | bd09afb5fb3e2047c605660dac6ef4495c419716 (patch) | |
tree | 205df2ab04d92e8093c341e132726325e9c40656 /activerecord/test/cases/validations | |
parent | 3d5e83fea4cc070fc55da535b7777a914301e284 (diff) | |
download | rails-bd09afb5fb3e2047c605660dac6ef4495c419716.tar.gz rails-bd09afb5fb3e2047c605660dac6ef4495c419716.tar.bz2 rails-bd09afb5fb3e2047c605660dac6ef4495c419716.zip |
Don't skip tests if we don't need to.
We can conditional define the tests depending on the adapter or
connection.
Lets keep the skip for fail tests that need to be fixed.
Diffstat (limited to 'activerecord/test/cases/validations')
-rw-r--r-- | activerecord/test/cases/validations/uniqueness_validation_test.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/activerecord/test/cases/validations/uniqueness_validation_test.rb b/activerecord/test/cases/validations/uniqueness_validation_test.rb index 2b33f01783..56d8db0be9 100644 --- a/activerecord/test/cases/validations/uniqueness_validation_test.rb +++ b/activerecord/test/cases/validations/uniqueness_validation_test.rb @@ -365,15 +365,15 @@ class UniquenessValidationTest < ActiveRecord::TestCase } end - def test_validate_uniqueness_with_array_column - return skip "Uniqueness on arrays has only been tested in PostgreSQL so far." if !current_adapter? :PostgreSQLAdapter - - 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" + 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 end |