aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/models/attachments_test.rb11
-rw-r--r--test/test_helper.rb4
2 files changed, 11 insertions, 4 deletions
diff --git a/test/models/attachments_test.rb b/test/models/attachments_test.rb
index c0f5db819d..eac3cbe680 100644
--- a/test/models/attachments_test.rb
+++ b/test/models/attachments_test.rb
@@ -68,6 +68,17 @@ class ActiveStorage::AttachmentsTest < ActiveSupport::TestCase
assert_equal "country.jpg", @user.highlights.second.filename.to_s
end
+ test "find attached blobs" do
+ @user.highlights.attach(
+ { io: StringIO.new("STUFF"), filename: "town.jpg", content_type: "image/jpg" },
+ { io: StringIO.new("IT"), filename: "country.jpg", content_type: "image/jpg" })
+
+ highlights = User.where(id: @user.id).with_attached_highlights.first.highlights
+
+ assert_equal "town.jpg", highlights.first.filename.to_s
+ assert_equal "country.jpg", highlights.second.filename.to_s
+ end
+
test "purge attached blobs" do
@user.highlights.attach create_blob(filename: "funky.jpg"), create_blob(filename: "wonky.jpg")
highlight_keys = @user.highlights.collect(&:key)
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 650e997205..a6e228c4d2 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -62,7 +62,3 @@ end
require "active_storage/attached"
ActiveRecord::Base.send :extend, ActiveStorage::Attached::Macros
-
-require "global_id"
-GlobalID.app = "ActiveStorageExampleApp"
-ActiveRecord::Base.send :include, GlobalID::Identification