From f2f5c7979022863d02c706b685ee1233e5fdf5bb Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 9 Jul 2017 18:16:06 +0200 Subject: Accept sgids for existing blobs created via direct upload as an attachable --- test/attachments_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/attachments_test.rb b/test/attachments_test.rb index 33bbff716d..ec7e9fcd5b 100644 --- a/test/attachments_test.rb +++ b/test/attachments_test.rb @@ -25,6 +25,11 @@ class ActiveStorage::AttachmentsTest < ActiveSupport::TestCase assert_equal "funky.jpg", @user.avatar.filename.to_s end + test "attach existing sgid blob" do + @user.avatar.attach create_blob(filename: "funky.jpg").to_sgid.to_s + assert_equal "funky.jpg", @user.avatar.filename.to_s + end + test "attach new blob" do @user.avatar.attach io: StringIO.new("STUFF"), filename: "town.jpg", content_type: "image/jpg" assert_equal "town.jpg", @user.avatar.filename.to_s -- cgit v1.2.3