aboutsummaryrefslogtreecommitdiffstats
path: root/test/models
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2017-07-28 15:27:43 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2017-07-28 15:27:43 -0500
commit801b4eb465cd48435abddac881b92c93470b6933 (patch)
tree63b96f17c29a25807da725b23b7f2706b3d2b877 /test/models
parent696b8c6f43214ed4b9b79f36a9f68de0db19f1ee (diff)
downloadrails-801b4eb465cd48435abddac881b92c93470b6933.tar.gz
rails-801b4eb465cd48435abddac881b92c93470b6933.tar.bz2
rails-801b4eb465cd48435abddac881b92c93470b6933.zip
Add Blob#type as a StringInquirer
Diffstat (limited to 'test/models')
-rw-r--r--test/models/blob_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/models/blob_test.rb b/test/models/blob_test.rb
index a5b291d5db..b51be7a93b 100644
--- a/test/models/blob_test.rb
+++ b/test/models/blob_test.rb
@@ -11,6 +11,12 @@ class ActiveStorage::BlobTest < ActiveSupport::TestCase
assert_equal Digest::MD5.base64digest(data), blob.checksum
end
+ test "inquery type" do
+ blob = create_blob data: "Hello world!"
+ assert blob.type.text?
+ assert_not blob.type.audio?
+ end
+
test "download yields chunks" do
blob = create_blob data: "a" * 75.kilobytes
chunks = []