diff options
author | Douwe Maan <douwe@selenight.nl> | 2018-06-15 13:28:23 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2018-06-15 13:28:23 +0300 |
commit | 5fc3b8a08d9264eedbf886c45b4ef7b418df380d (patch) | |
tree | 43a12031b52f267237f2539b42815c33061f82ea /spec | |
parent | a8445cc29d81f8d8169e93cd4ef6692aa0fef1fb (diff) |
Remove FaviconUploader favicon_main version
See https://gitlab.com/gitlab-org/gitlab-ce/issues/47677 for more information
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/uploads_controller_spec.rb | 17 | ||||
-rw-r--r-- | spec/lib/gitlab/favicon_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/project_services/jira_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/uploaders/favicon_uploader_spec.rb | 29 |
4 files changed, 2 insertions, 48 deletions
diff --git a/spec/controllers/uploads_controller_spec.rb b/spec/controllers/uploads_controller_spec.rb index 1df2c954893..eb94d395a9e 100644 --- a/spec/controllers/uploads_controller_spec.rb +++ b/spec/controllers/uploads_controller_spec.rb @@ -580,23 +580,6 @@ describe UploadsController do expect(response).to have_gitlab_http_status(404) end end - - context 'has a valid filename on the version file' do - it 'successfully returns the file' do - get :show, model: 'appearance', mounted_as: 'favicon', id: appearance.id, filename: 'favicon_main_dk.png' - - expect(response).to have_gitlab_http_status(200) - expect(response.header['Content-Disposition']).to end_with 'filename="favicon_main_dk.png"' - end - end - - context 'has an invalid filename on the version file' do - it 'returns a 404' do - get :show, model: 'appearance', mounted_as: 'favicon', id: appearance.id, filename: 'favicon_bogusversion_dk.png' - - expect(response).to have_gitlab_http_status(404) - end - end end end end diff --git a/spec/lib/gitlab/favicon_spec.rb b/spec/lib/gitlab/favicon_spec.rb index 08c4a474217..f36111a4946 100644 --- a/spec/lib/gitlab/favicon_spec.rb +++ b/spec/lib/gitlab/favicon_spec.rb @@ -19,7 +19,7 @@ RSpec.describe Gitlab::Favicon, :request_store do it 'uses the custom favicon if a favicon appearance is present' do create :appearance, favicon: fixture_file_upload('spec/fixtures/dk.png') - expect(described_class.main).to match %r{/uploads/-/system/appearance/favicon/\d+/favicon_main_dk.png} + expect(described_class.main).to match %r{/uploads/-/system/appearance/favicon/\d+/dk.png} end end diff --git a/spec/models/project_services/jira_service_spec.rb b/spec/models/project_services/jira_service_spec.rb index b9f1c7dd5df..6c637533c6b 100644 --- a/spec/models/project_services/jira_service_spec.rb +++ b/spec/models/project_services/jira_service_spec.rb @@ -478,7 +478,7 @@ describe JiraService do create :appearance, favicon: fixture_file_upload('spec/fixtures/dk.png') props = described_class.new.send(:build_remote_link_props, url: 'http://example.com', title: 'title') - expect(props[:object][:icon][:url16x16]).to match %r{^http://localhost/uploads/-/system/appearance/favicon/\d+/favicon_main_dk.png$} + expect(props[:object][:icon][:url16x16]).to match %r{^http://localhost/uploads/-/system/appearance/favicon/\d+/dk.png$} end end end diff --git a/spec/uploaders/favicon_uploader_spec.rb b/spec/uploaders/favicon_uploader_spec.rb deleted file mode 100644 index 37deea8ab90..00000000000 --- a/spec/uploaders/favicon_uploader_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -require 'spec_helper' - -RSpec.describe FaviconUploader do - include CarrierWave::Test::Matchers - - let(:uploader) { described_class.new(build_stubbed(:user)) } - - after do - uploader.remove! - end - - def upload_fixture(filename) - fixture_file_upload("spec/fixtures/#{filename}") - end - - context 'versions' do - before do - uploader.store!(upload_fixture('dk.png')) - end - - it 'has the correct format' do - expect(uploader.favicon_main).to be_format('png') - end - - it 'has the correct dimensions' do - expect(uploader.favicon_main).to have_dimensions(32, 32) - end - end -end |