Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2019-01-22 00:25:54 +0300
committerTim Zallmann <tzallmann@gitlab.com>2019-01-22 00:25:54 +0300
commit5fc63a1d232608530a4cd4a45c34a2bed695169a (patch)
tree7d1d6c680aa048429a1472955798681110df0976 /spec/controllers/uploads_controller_spec.rb
parentc141d0afb15366beb1cae8a240faf6aaeb632214 (diff)
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.rb9
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' }