Skip to content
Snippets Groups Projects
Commit 9a15b112 authored by Alexis Reigel's avatar Alexis Reigel Committed by Rémy Coutable
Browse files

Fixes the 500 for custom apearance header logo and logo

parent dda66953
No related branches found
No related tags found
1 merge request!12073Add RC2 changes to 9-3-stable
Loading
Loading
@@ -21,6 +21,8 @@ class UploadsController < ApplicationController
can?(current_user, :read_project, model.project)
when User
true
when Appearance
true
else
permission = "read_#{model.class.to_s.underscore}".to_sym
 
Loading
Loading
---
title: Fixes the 500 when accessing customized appearance logos
merge_request: 11479
author: Alexis Reigel
Loading
Loading
@@ -473,5 +473,45 @@ describe UploadsController do
end
end
end
context 'Appearance' do
context 'when viewing a custom header logo' do
let!(:appearance) { create :appearance, header_logo: fixture_file_upload(Rails.root.join('spec/fixtures/dk.png'), 'image/png') }
context 'when not signed in' do
it 'responds with status 200' do
get :show, model: 'appearance', mounted_as: 'header_logo', id: appearance.id, filename: 'dk.png'
expect(response).to have_http_status(200)
end
it_behaves_like 'content not cached without revalidation' do
subject do
get :show, model: 'appearance', mounted_as: 'header_logo', id: appearance.id, filename: 'dk.png'
response
end
end
end
end
context 'when viewing a custom logo' do
let!(:appearance) { create :appearance, logo: fixture_file_upload(Rails.root.join('spec/fixtures/dk.png'), 'image/png') }
context 'when not signed in' do
it 'responds with status 200' do
get :show, model: 'appearance', mounted_as: 'logo', id: appearance.id, filename: 'dk.png'
expect(response).to have_http_status(200)
end
it_behaves_like 'content not cached without revalidation' do
subject do
get :show, model: 'appearance', mounted_as: 'logo', id: appearance.id, filename: 'dk.png'
response
end
end
end
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment