Skip to content
Snippets Groups Projects
Commit 0bce9872 authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Merge branch 'fix/allow-accessing-appearance-images' into 'master'

Fixes the 500 for custom apearance header logo and logo

See merge request !11479
parents dda66953 9a15b112
No related branches found
No related tags found
2 merge requests!12073Add RC2 changes to 9-3-stable,!11479Fixes the 500 for custom apearance header logo and logo
Pipeline #
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