diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-08-09 22:06:49 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-08-09 22:06:49 +0300 |
commit | c78b672beba10f720e4e59cdc79e42cb79b9b811 (patch) | |
tree | a051db9f0eef11c854ebc80e348e4e7ace21eb3e | |
parent | da589fcc4a15cdc923b9df55f9fe964df996e49b (diff) | |
download | rails-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.rb | 7 |
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 |