diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2019-01-21 22:25:54 +0100 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2019-01-21 22:25:54 +0100 |
commit | 5fc63a1d232608530a4cd4a45c34a2bed695169a (patch) | |
tree | 7d1d6c680aa048429a1472955798681110df0976 /spec/controllers/uploads_controller_spec.rb | |
parent | c141d0afb15366beb1cae8a240faf6aaeb632214 (diff) | |
download | gitlab-ce-5fc63a1d232608530a4cd4a45c34a2bed695169a.tar.gz |
Changed the Caching of User Avatars to be public and to 5 minutes
Diffstat (limited to 'spec/controllers/uploads_controller_spec.rb')
-rw-r--r-- | spec/controllers/uploads_controller_spec.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/controllers/uploads_controller_spec.rb b/spec/controllers/uploads_controller_spec.rb index 19142aa1272..482f9af7211 100644 --- a/spec/controllers/uploads_controller_spec.rb +++ b/spec/controllers/uploads_controller_spec.rb @@ -12,6 +12,13 @@ shared_examples 'content not cached without revalidation and no-store' do end end +shared_examples 'content publicy cached' do + it 'ensures content is publicly cached' do + # Fixed in newer versions of ActivePack, it will only output a single `private`. + expect(subject['Cache-Control']).to eq('max-age=300, public') + end +end + describe UploadsController do let!(:user) { create(:user, avatar: fixture_file_upload("spec/fixtures/dk.png", "image/png")) } @@ -184,7 +191,7 @@ describe UploadsController do expect(response).to have_gitlab_http_status(200) end - it_behaves_like 'content not cached without revalidation and no-store' do + it_behaves_like 'content publicy cached' do subject do get :show, params: { model: 'user', mounted_as: 'avatar', id: user.id, filename: 'dk.png' } |