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

23 lines
576 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require "test_helper"
require "database/setup"
class ActiveStorage::BlobsControllerTest < ActionDispatch::IntegrationTest
setup do
2017-09-28 16:43:37 -04:00
@blob = create_file_blob filename: "racecar.jpg"
end
test "showing blob with invalid signed ID" do
get rails_service_blob_url("invalid", "racecar.jpg")
assert_response :not_found
end
test "showing blob utilizes browser caching" do
get rails_blob_url(@blob)
assert_redirected_to(/racecar\.jpg/)
assert_equal "max-age=300, private", @response.headers["Cache-Control"]
end
end