1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Should escape regexp wildcard character .

This commit is contained in:
Koichi ITO 2017-08-14 22:17:50 +09:00
parent 57585b6f3b
commit 2b6e85c190
3 changed files with 4 additions and 4 deletions

View file

@ -11,7 +11,7 @@ class ActiveStorage::BlobsControllerTest < ActionDispatch::IntegrationTest
test "showing blob utilizes browser caching" do test "showing blob utilizes browser caching" do
get rails_blob_url(@blob) get rails_blob_url(@blob)
assert_redirected_to(/racecar.jpg/) assert_redirected_to(/racecar\.jpg/)
assert_equal "max-age=300, private", @response.headers["Cache-Control"] assert_equal "max-age=300, private", @response.headers["Cache-Control"]
end end
end end

View file

@ -14,7 +14,7 @@ class ActiveStorage::VariantsControllerTest < ActionDispatch::IntegrationTest
signed_blob_id: @blob.signed_id, signed_blob_id: @blob.signed_id,
variation_key: ActiveStorage::Variation.encode(resize: "100x100")) variation_key: ActiveStorage::Variation.encode(resize: "100x100"))
assert_redirected_to(/racecar.jpg\?.*disposition=inline/) assert_redirected_to(/racecar\.jpg\?.*disposition=inline/)
image = read_image_variant(@blob.variant(resize: "100x100")) image = read_image_variant(@blob.variant(resize: "100x100"))
assert_equal 100, image.width assert_equal 100, image.width

View file

@ -10,7 +10,7 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase
test "resized variation" do test "resized variation" do
variant = @blob.variant(resize: "100x100").processed variant = @blob.variant(resize: "100x100").processed
assert_match(/racecar.jpg/, variant.service_url) assert_match(/racecar\.jpg/, variant.service_url)
image = read_image_variant(variant) image = read_image_variant(variant)
assert_equal 100, image.width assert_equal 100, image.width
@ -19,7 +19,7 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase
test "resized and monochrome variation" do test "resized and monochrome variation" do
variant = @blob.variant(resize: "100x100", monochrome: true).processed variant = @blob.variant(resize: "100x100", monochrome: true).processed
assert_match(/racecar.jpg/, variant.service_url) assert_match(/racecar\.jpg/, variant.service_url)
image = read_image_variant(variant) image = read_image_variant(variant)
assert_equal 100, image.width assert_equal 100, image.width