aboutsummaryrefslogblamecommitdiffstats
path: root/activestorage/test/controllers/blobs_controller_test.rb
blob: 97177e64c2a4539f0d9978050d1eff7412843fa3 (plain) (tree)
1
2
3
4
5
6
7
8

                             




                                                                          
                                                    




                                                 
                                        


                                                                           
# frozen_string_literal: true

require "test_helper"
require "database/setup"

class ActiveStorage::BlobsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @blob = create_file_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