about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/fabricators/custom_emoji_fabricator.rb2
-rw-r--r--spec/fabricators/site_upload_fabricator.rb2
-rw-r--r--spec/rails_helper.rb4
3 files changed, 4 insertions, 4 deletions
diff --git a/spec/fabricators/custom_emoji_fabricator.rb b/spec/fabricators/custom_emoji_fabricator.rb
index 298a50b4b..fa570eec6 100644
--- a/spec/fabricators/custom_emoji_fabricator.rb
+++ b/spec/fabricators/custom_emoji_fabricator.rb
@@ -3,5 +3,5 @@
 Fabricator(:custom_emoji) do
   shortcode 'coolcat'
   domain    nil
-  image     { File.open(Rails.root.join('spec', 'fixtures', 'files', 'emojo.png')) }
+  image     { Rails.root.join('spec', 'fixtures', 'files', 'emojo.png').open }
 end
diff --git a/spec/fabricators/site_upload_fabricator.rb b/spec/fabricators/site_upload_fabricator.rb
index b6841dea3..ad1b777cc 100644
--- a/spec/fabricators/site_upload_fabricator.rb
+++ b/spec/fabricators/site_upload_fabricator.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 Fabricator(:site_upload) do
-  file { File.open(File.join(Rails.root, 'spec', 'fabricators', 'assets', 'utah_teapot.png')) }
+  file { Rails.root.join('spec', 'fabricators', 'assets', 'utah_teapot.png').open }
 end
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index faae02df0..70d3a968c 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -73,11 +73,11 @@ end
 RSpec::Matchers.define_negated_matcher :not_change, :change
 
 def request_fixture(name)
-  File.read(Rails.root.join('spec', 'fixtures', 'requests', name))
+  Rails.root.join('spec', 'fixtures', 'requests', name).read
 end
 
 def attachment_fixture(name)
-  File.open(Rails.root.join('spec', 'fixtures', 'files', name))
+  Rails.root.join('spec', 'fixtures', 'files', name).open
 end
 
 def stub_jsonld_contexts!