aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/test_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activestorage/test/test_helper.rb')
-rw-r--r--activestorage/test/test_helper.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activestorage/test/test_helper.rb b/activestorage/test/test_helper.rb
index 573a8e0b0b..7b7926ac79 100644
--- a/activestorage/test/test_helper.rb
+++ b/activestorage/test/test_helper.rb
@@ -79,6 +79,10 @@ class ActiveSupport::TestCase
def extract_metadata_from(blob)
blob.tap(&:analyze).metadata
end
+
+ def fixture_file_upload(filename)
+ Rack::Test::UploadedFile.new file_fixture(filename).to_s
+ end
end
require "global_id"
@@ -86,9 +90,15 @@ GlobalID.app = "ActiveStorageExampleApp"
ActiveRecord::Base.send :include, GlobalID::Identification
class User < ActiveRecord::Base
+ validates :name, presence: true
+
has_one_attached :avatar
has_one_attached :cover_photo, dependent: false
has_many_attached :highlights
has_many_attached :vlogs, dependent: false
end
+
+class Group < ActiveRecord::Base
+ has_one_attached :avatar
+end