Skip to content

Commit

Permalink
Should escape regexp wildcard character .
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Aug 14, 2017
1 parent 57585b6 commit 2b6e85c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion activestorage/test/controllers/blobs_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ActiveStorage::BlobsControllerTest < ActionDispatch::IntegrationTest
test "showing blob utilizes browser caching" do
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"]
end
end
2 changes: 1 addition & 1 deletion activestorage/test/controllers/variants_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ActiveStorage::VariantsControllerTest < ActionDispatch::IntegrationTest
signed_blob_id: @blob.signed_id,
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"))
assert_equal 100, image.width
Expand Down
4 changes: 2 additions & 2 deletions activestorage/test/models/variant_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase

test "resized variation" do
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)
assert_equal 100, image.width
Expand All @@ -19,7 +19,7 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase

test "resized and monochrome variation" do
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)
assert_equal 100, image.width
Expand Down

0 comments on commit 2b6e85c

Please sign in to comment.