aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/models/variant_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activestorage/test/models/variant_test.rb')
-rw-r--r--activestorage/test/models/variant_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activestorage/test/models/variant_test.rb b/activestorage/test/models/variant_test.rb
index 92e3384042..6b43923159 100644
--- a/activestorage/test/models/variant_test.rb
+++ b/activestorage/test/models/variant_test.rb
@@ -4,6 +4,14 @@ require "test_helper"
require "database/setup"
class ActiveStorage::VariantTest < ActiveSupport::TestCase
+ test "variations have the same key for different types of the same transformation" do
+ blob = create_file_blob(filename: "racecar.jpg")
+ variant_a = blob.variant(resize: "100x100")
+ variant_b = blob.variant("resize" => "100x100")
+
+ assert_equal variant_a.key, variant_b.key
+ end
+
test "resized variation of JPEG blob" do
blob = create_file_blob(filename: "racecar.jpg")
variant = blob.variant(resize: "100x100").processed