Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-09-28 14:57:08 +0300
committerAlexis Reigel <mail@koffeinfrei.org>2018-06-05 17:20:21 +0300
commit67fe0a17d87a7a5380b41e04ef23212d5da637ba (patch)
tree2be846ca693640f73058ebd0dd1b39b06e3f2666 /spec/lib/gitlab/favicon_spec.rb
parent40ffa8401b96dda5f67ea699dbcca0ff64263810 (diff)
call Gitlab::Favicon.status in serializer
this ways we can keep the `lib/gitlab/ci/status/*` classes to return the bare favicon name as it was before. also the favicon uploader versions are now have the same names as the stock favicons (+ `favicon_` prefix), which makes working with the status names easier.
Diffstat (limited to 'spec/lib/gitlab/favicon_spec.rb')
-rw-r--r--spec/lib/gitlab/favicon_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/lib/gitlab/favicon_spec.rb b/spec/lib/gitlab/favicon_spec.rb
index ddfa81c0b5d..51b8fda81d1 100644
--- a/spec/lib/gitlab/favicon_spec.rb
+++ b/spec/lib/gitlab/favicon_spec.rb
@@ -1,38 +1,38 @@
require 'rails_helper'
RSpec.describe Gitlab::Favicon, :request_store do
- describe '.default' do
+ describe '.main' do
it 'defaults to favicon.ico' do
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('production'))
- expect(described_class.default).to eq 'favicon.ico'
+ expect(described_class.main).to eq 'favicon.ico'
end
it 'has blue favicon for development' do
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('development'))
- expect(described_class.default).to eq 'favicon-blue.ico'
+ expect(described_class.main).to eq 'favicon-blue.ico'
end
it 'has yellow favicon for canary' do
stub_env('CANARY', 'true')
- expect(described_class.favicon).to eq 'favicon-yellow.ico'
+ expect(described_class.main).to eq 'favicon-yellow.ico'
end
it 'uses the custom favicon if a favicon appearance is present' do
create :appearance, favicon: fixture_file_upload(Rails.root.join('spec/fixtures/dk.png'))
- expect(described_class.default).to match %r{/uploads/-/system/appearance/favicon/\d+/default_dk.ico\?}
+ expect(described_class.main).to match %r{/uploads/-/system/appearance/favicon/\d+/favicon_main_dk.ico}
end
end
describe '.status' do
- subject { described_class.status('created') }
+ subject { described_class.status('favicon_status_created') }
it 'defaults to the stock icon' do
- expect(subject).to eq 'ci_favicons/favicon_status_created.ico'
+ expect(subject).to eq '/assets/ci_favicons/favicon_status_created.ico'
end
it 'uses the custom favicon if a favicon appearance is present' do
create :appearance, favicon: fixture_file_upload(Rails.root.join('spec/fixtures/dk.png'))
- expect(subject).to match(%r{/uploads/-/system/appearance/favicon/\d+/status_created_dk.ico\?})
+ expect(subject).to match(%r{/uploads/-/system/appearance/favicon/\d+/favicon_status_created_dk.ico})
end
end
end