aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/models
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2019-03-28 18:47:42 -0400
committerGeorge Claghorn <george@basecamp.com>2019-03-28 18:47:42 -0400
commit562f3a2d21de52872ccd9a2c8b734e30ec63430b (patch)
tree54b75b83739e9efa3d19a0f88ed3b1f5193fe367 /activestorage/test/models
parente3f5f1c936869b81b01835adc9c683e058edfeaf (diff)
downloadrails-562f3a2d21de52872ccd9a2c8b734e30ec63430b.tar.gz
rails-562f3a2d21de52872ccd9a2c8b734e30ec63430b.tar.bz2
rails-562f3a2d21de52872ccd9a2c8b734e30ec63430b.zip
Add ActiveStorage::Service#open
Diffstat (limited to 'activestorage/test/models')
-rw-r--r--activestorage/test/models/blob_test.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/activestorage/test/models/blob_test.rb b/activestorage/test/models/blob_test.rb
index 54cf9e2b8a..b7b37bacf5 100644
--- a/activestorage/test/models/blob_test.rb
+++ b/activestorage/test/models/blob_test.rb
@@ -104,14 +104,12 @@ class ActiveStorage::BlobTest < ActiveSupport::TestCase
end
end
- test "open in a custom tempdir" do
- tempdir = Dir.mktmpdir
-
- create_file_blob(filename: "racecar.jpg").open(tempdir: tempdir) do |file|
+ test "open in a custom tmpdir" do
+ create_file_blob(filename: "racecar.jpg").open(tmpdir: tmpdir = Dir.mktmpdir) do |file|
assert file.binmode?
assert_equal 0, file.pos
assert_match(/\.jpg\z/, file.path)
- assert file.path.starts_with?(tempdir)
+ assert file.path.starts_with?(tmpdir)
assert_equal file_fixture("racecar.jpg").binread, file.read, "Expected downloaded file to match fixture file"
end
end