1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/test/variant_test.rb
David Heinemeier Hansson c695263881 Precise naming
2017-07-21 15:52:09 -05:00

19 lines
625 B
Ruby

require "test_helper"
require "database/setup"
require "active_storage/variant"
class ActiveStorage::VariantTest < ActiveSupport::TestCase
setup do
@blob = ActiveStorage::Blob.create_after_upload! \
filename: "racecar.jpg", content_type: "image/jpeg",
io: File.open(File.expand_path("../fixtures/files/racecar.jpg", __FILE__))
end
test "resized variation" do
assert_match /racecar.jpg/, @blob.variant(resize: "100x100").processed.url
end
test "resized and monochrome variation" do
assert_match /racecar.jpg/, @blob.variant(resize: "100x100", monochrome: true).processed.url
end
end