aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/analyzer/image_analyzer_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activestorage/test/analyzer/image_analyzer_test.rb')
-rw-r--r--activestorage/test/analyzer/image_analyzer_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activestorage/test/analyzer/image_analyzer_test.rb b/activestorage/test/analyzer/image_analyzer_test.rb
index 55bb5e7280..73438c15ab 100644
--- a/activestorage/test/analyzer/image_analyzer_test.rb
+++ b/activestorage/test/analyzer/image_analyzer_test.rb
@@ -29,4 +29,12 @@ class ActiveStorage::Analyzer::ImageAnalyzerTest < ActiveSupport::TestCase
assert_equal 792, metadata[:width]
assert_equal 584, metadata[:height]
end
+
+ test "analyzing an unsupported image type" do
+ blob = create_blob(data: "bad", filename: "bad_file.bad", content_type: "image/bad_type")
+ metadata = extract_metadata_from(blob)
+
+ assert_nil metadata[:width]
+ assert_nil metadata[:heigh]
+ end
end