Skip to content

Commit 80a6291

Browse files
committed
Add test
1 parent 7511c28 commit 80a6291

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

activestorage/test/models/attachment_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ class ActiveStorage::AttachmentTest < ActiveSupport::TestCase
159159
assert_nothing_raised { attachment.destroy }
160160
end
161161

162+
test "can create an attachment with the record having no attachment reflections" do
163+
assert_nothing_raised { ActiveStorage::Attachment.create!(name: "whatever", record: @user, blob: create_blob) }
164+
end
165+
162166
private
163167
def assert_blob_identified_before_owner_validated(owner, blob, content_type)
164168
validated_content_type = nil

0 commit comments

Comments
 (0)