Fixed static analysis error and 2 caching specs

This commit is contained in:
Tim Zallmann 2019-01-21 23:58:54 +01:00
parent 5fc63a1d23
commit 86cda964cf
2 changed files with 6 additions and 6 deletions

View File

@ -71,7 +71,7 @@ class UploadsController < ApplicationController
end
def cache_privately?
true unless (User === model || Appearance === model)
true unless User === model || Appearance === model
end
def upload_model_class

View File

@ -12,7 +12,7 @@ shared_examples 'content not cached without revalidation and no-store' do
end
end
shared_examples 'content publicy cached' do
shared_examples 'content publicly 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')
@ -191,7 +191,7 @@ describe UploadsController do
expect(response).to have_gitlab_http_status(200)
end
it_behaves_like 'content publicy cached' do
it_behaves_like 'content publicly cached' do
subject do
get :show, params: { model: 'user', mounted_as: 'avatar', id: user.id, filename: 'dk.png' }
@ -208,7 +208,7 @@ describe UploadsController do
expect(response).to have_gitlab_http_status(200)
end
it_behaves_like 'content not cached without revalidation' do
it_behaves_like 'content publicly cached' do
subject do
get :show, params: { model: 'user', mounted_as: 'avatar', id: user.id, filename: 'dk.png' }
@ -544,7 +544,7 @@ describe UploadsController do
expect(response).to have_gitlab_http_status(200)
end
it_behaves_like 'content not cached without revalidation' do
it_behaves_like 'content publicly cached' do
subject do
get :show, params: { model: 'appearance', mounted_as: 'header_logo', id: appearance.id, filename: 'dk.png' }
@ -564,7 +564,7 @@ describe UploadsController do
expect(response).to have_gitlab_http_status(200)
end
it_behaves_like 'content not cached without revalidation' do
it_behaves_like 'content publicly cached' do
subject do
get :show, params: { model: 'appearance', mounted_as: 'logo', id: appearance.id, filename: 'dk.png' }