aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-03-09 08:37:28 -0600
committerSean Griffin <sean@thoughtbot.com>2015-03-09 08:37:28 -0600
commit503c2d412a9d80391d81bfcec7315c05e87461fd (patch)
treea5e131ed9aeeccc63a00f66087ff9ff116998efa /activerecord/test
parentba8ce39877cbe62522ddecd2965edcd9c6304adf (diff)
downloadrails-503c2d412a9d80391d81bfcec7315c05e87461fd.tar.gz
rails-503c2d412a9d80391d81bfcec7315c05e87461fd.tar.bz2
rails-503c2d412a9d80391d81bfcec7315c05e87461fd.zip
Fix intermittent test failures
The default value of `"pg_arrays"."tags"` is being changed to `[]` in one test, but the column information on the model isn't reset after it's changed back. As such, we think the default value is `[]` when in the database it's actually `nil`. That means any test which was assigning `[]` to a new record would have that key skipped with partial writes, as it hasn't changed from the default. However since the *actual* default value is `nil`, we get back values that the test doesn't expect, and it fails.
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/adapters/postgresql/array_test.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/array_test.rb b/activerecord/test/cases/adapters/postgresql/array_test.rb
index 2163e35e70..6edbd9c3a6 100644
--- a/activerecord/test/cases/adapters/postgresql/array_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/array_test.rb
@@ -23,6 +23,7 @@ class PostgresqlArrayTest < ActiveRecord::TestCase
t.hstore :hstores, array: true
end
end
+ PgArray.reset_column_information
@column = PgArray.columns_hash['tags']
@type = PgArray.type_for_attribute("tags")
end