aboutsummaryrefslogtreecommitdiffstats
path: root/test/models/attachments_test.rb
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2017-07-23 21:41:16 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2017-07-23 21:41:16 +0200
commita4f36f957e013f6da34e04f0d3f1d86d86491454 (patch)
treef6f3427278a90369f334b996c8e297c842b248af /test/models/attachments_test.rb
parent212f925654f944067f18429ca02d902473214722 (diff)
downloadrails-a4f36f957e013f6da34e04f0d3f1d86d86491454.tar.gz
rails-a4f36f957e013f6da34e04f0d3f1d86d86491454.tar.bz2
rails-a4f36f957e013f6da34e04f0d3f1d86d86491454.zip
Fix attaching with standard Rails associations.
Removes needless ivar caching (a Rails association handles that). Inserts a reload and a nil assign, since the association proxy doesn't seem to that it's been destroyed through `purge`.
Diffstat (limited to 'test/models/attachments_test.rb')
-rw-r--r--test/models/attachments_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/models/attachments_test.rb b/test/models/attachments_test.rb
index 1a9fc6f932..45f62b0bbf 100644
--- a/test/models/attachments_test.rb
+++ b/test/models/attachments_test.rb
@@ -70,9 +70,9 @@ class ActiveStorage::AttachmentsTest < ActiveSupport::TestCase
test "find attached blobs" do
@user.highlights.attach(
- { io: StringIO.new("STUFF"), filename: "town.jpg", content_type: "image/jpg" },
+ { io: StringIO.new("STUFF"), filename: "town.jpg", content_type: "image/jpg" },
{ io: StringIO.new("IT"), filename: "country.jpg", content_type: "image/jpg" })
-
+
User.where(id: @user.id).includes(highlights_attachments: :blob).first
end