aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/models/attached/one_test.rb
diff options
context:
space:
mode:
authorGeorge Claghorn <george.claghorn@gmail.com>2019-02-26 12:11:50 -0500
committerGitHub <noreply@github.com>2019-02-26 12:11:50 -0500
commit7c95c522473ec7efb7830f8afa056805ce3d6128 (patch)
treef5c726b7eabcbd010e8f77a9afb4535036eed39a /activestorage/test/models/attached/one_test.rb
parentaa9bc1e8f023b227d77aeee99cefde48c247b88d (diff)
parent32438ed64fea7dbe52ea0898be3d4276e63baa78 (diff)
downloadrails-7c95c522473ec7efb7830f8afa056805ce3d6128.tar.gz
rails-7c95c522473ec7efb7830f8afa056805ce3d6128.tar.bz2
rails-7c95c522473ec7efb7830f8afa056805ce3d6128.zip
Merge pull request #35412 from abhchand/correctly-load-blob-association
Ensure that the `_blob` association is properly loaded when attaching `::One`
Diffstat (limited to 'activestorage/test/models/attached/one_test.rb')
-rw-r--r--activestorage/test/models/attached/one_test.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activestorage/test/models/attached/one_test.rb b/activestorage/test/models/attached/one_test.rb
index 7fb3262781..ac08d324bb 100644
--- a/activestorage/test/models/attached/one_test.rb
+++ b/activestorage/test/models/attached/one_test.rb
@@ -15,6 +15,9 @@ class ActiveStorage::OneAttachedTest < ActiveSupport::TestCase
test "attaching an existing blob to an existing record" do
@user.avatar.attach create_blob(filename: "funky.jpg")
assert_equal "funky.jpg", @user.avatar.filename.to_s
+
+ assert_not_nil @user.avatar_attachment
+ assert_not_nil @user.avatar_blob
end
test "attaching an existing blob from a signed ID to an existing record" do