aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbogdanvlviv <bogdanvlviv@gmail.com>2017-08-09 22:06:49 +0300
committerbogdanvlviv <bogdanvlviv@gmail.com>2017-08-09 22:06:49 +0300
commitc78b672beba10f720e4e59cdc79e42cb79b9b811 (patch)
treea051db9f0eef11c854ebc80e348e4e7ace21eb3e
parentda589fcc4a15cdc923b9df55f9fe964df996e49b (diff)
downloadrails-c78b672beba10f720e4e59cdc79e42cb79b9b811.tar.gz
rails-c78b672beba10f720e4e59cdc79e42cb79b9b811.tar.bz2
rails-c78b672beba10f720e4e59cdc79e42cb79b9b811.zip
Fix random CI failure DirtyTest:
``` rails/activerecord$ bundle exec rake postgresql:test TESTOPTS="--seed=26536" ..(compressed)....F Failure: DirtyTest#test_save_should_not_save_serialized_attribute_with_partial_writes_if_not_present [/home/travis/build/rails/rails/activerecord/test/cases/dirty_test.rb:473]: Expected nil to not be nil. ```
-rw-r--r--activerecord/test/cases/dirty_test.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb
index fb3d691d51..a602f83d8c 100644
--- a/activerecord/test/cases/dirty_test.rb
+++ b/activerecord/test/cases/dirty_test.rb
@@ -466,11 +466,10 @@ class DirtyTest < ActiveRecord::TestCase
def test_save_should_not_save_serialized_attribute_with_partial_writes_if_not_present
with_partial_writes(Topic) do
- Topic.create!(author_name: "Bill", content: { a: "a" })
- topic = Topic.select("id, author_name").first
+ topic = Topic.create!(author_name: "Bill", content: { a: "a" })
+ topic = Topic.select("id, author_name").find(topic.id)
topic.update_columns author_name: "John"
- topic = Topic.first
- assert_not_nil topic.content
+ assert_not_nil topic.reload.content
end
end