From e25466b142c067ad44130d93fa864f5ffa9643bb Mon Sep 17 00:00:00 2001 From: Anton Khamets Date: Fri, 11 Aug 2017 20:18:12 +0300 Subject: Enable browser caching for blobs and variants (#30196) --- activestorage/test/controllers/blobs_controller_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 activestorage/test/controllers/blobs_controller_test.rb (limited to 'activestorage/test/controllers') diff --git a/activestorage/test/controllers/blobs_controller_test.rb b/activestorage/test/controllers/blobs_controller_test.rb new file mode 100644 index 0000000000..5ec353889c --- /dev/null +++ b/activestorage/test/controllers/blobs_controller_test.rb @@ -0,0 +1,15 @@ +require "test_helper" +require "database/setup" + +class ActiveStorage::BlobsControllerTest < ActionDispatch::IntegrationTest + setup do + @blob = create_image_blob filename: "racecar.jpg" + 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 -- cgit v1.2.3