Commit 86cda964 authored by Tim Zallmann's avatar Tim Zallmann

Fixed static analysis error and 2 caching specs

parent 5fc63a1d
...@@ -71,7 +71,7 @@ class UploadsController < ApplicationController ...@@ -71,7 +71,7 @@ class UploadsController < ApplicationController
end end
def cache_privately? def cache_privately?
true unless (User === model || Appearance === model) true unless User === model || Appearance === model
end end
def upload_model_class def upload_model_class
......
...@@ -12,7 +12,7 @@ shared_examples 'content not cached without revalidation and no-store' do ...@@ -12,7 +12,7 @@ shared_examples 'content not cached without revalidation and no-store' do
end end
end end
shared_examples 'content publicy cached' do shared_examples 'content publicly cached' do
it 'ensures content is publicly cached' do it 'ensures content is publicly cached' do
# Fixed in newer versions of ActivePack, it will only output a single `private`. # Fixed in newer versions of ActivePack, it will only output a single `private`.
expect(subject['Cache-Control']).to eq('max-age=300, public') expect(subject['Cache-Control']).to eq('max-age=300, public')
...@@ -191,7 +191,7 @@ describe UploadsController do ...@@ -191,7 +191,7 @@ describe UploadsController do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content publicy cached' do it_behaves_like 'content publicly cached' do
subject do subject do
get :show, params: { model: 'user', mounted_as: 'avatar', id: user.id, filename: 'dk.png' } get :show, params: { model: 'user', mounted_as: 'avatar', id: user.id, filename: 'dk.png' }
...@@ -208,7 +208,7 @@ describe UploadsController do ...@@ -208,7 +208,7 @@ describe UploadsController do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content publicly cached' do
subject do subject do
get :show, params: { model: 'user', mounted_as: 'avatar', id: user.id, filename: 'dk.png' } get :show, params: { model: 'user', mounted_as: 'avatar', id: user.id, filename: 'dk.png' }
...@@ -544,7 +544,7 @@ describe UploadsController do ...@@ -544,7 +544,7 @@ describe UploadsController do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content publicly cached' do
subject do subject do
get :show, params: { model: 'appearance', mounted_as: 'header_logo', id: appearance.id, filename: 'dk.png' } get :show, params: { model: 'appearance', mounted_as: 'header_logo', id: appearance.id, filename: 'dk.png' }
...@@ -564,7 +564,7 @@ describe UploadsController do ...@@ -564,7 +564,7 @@ describe UploadsController do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content publicly cached' do
subject do subject do
get :show, params: { model: 'appearance', mounted_as: 'logo', id: appearance.id, filename: 'dk.png' } get :show, params: { model: 'appearance', mounted_as: 'logo', id: appearance.id, filename: 'dk.png' }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment