diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-05-19 09:20:51 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-05-19 09:20:51 +0000 |
commit | 9a15b112377e305bd55e2c539786aee7db569e29 (patch) | |
tree | bc70241f64d2e75c989f0a2630e31d9473748471 /spec/controllers | |
parent | dda66953ffbf102f3c9eef7921bb9a25d3b45b88 (diff) | |
download | gitlab-ce-9a15b112377e305bd55e2c539786aee7db569e29.tar.gz |
Fixes the 500 for custom apearance header logo and logo
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/uploads_controller_spec.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/controllers/uploads_controller_spec.rb b/spec/controllers/uploads_controller_spec.rb index 7dedfe160a6..8000c9dec61 100644 --- a/spec/controllers/uploads_controller_spec.rb +++ b/spec/controllers/uploads_controller_spec.rb @@ -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 |