override favicon for development to find tabs more easily

This commit is contained in:
Simon Knox 2017-02-16 01:07:29 +11:00
parent 35b31ba84f
commit e15032eded
4 changed files with 17 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

@ -34,6 +34,10 @@ module PageLayoutHelper
end
end
def favicon
Rails.env.development? ? 'favicon-purple.ico' : 'favicon.ico'
end
def page_image
default = image_url('gitlab_logo.png')

View file

@ -23,7 +23,7 @@
%title= page_title(site_name)
%meta{ name: "description", content: page_description }
= favicon_link_tag 'favicon.ico'
= favicon_link_tag favicon
= stylesheet_link_tag "application", media: "all"
= stylesheet_link_tag "print", media: "print"

View file

@ -40,6 +40,18 @@ describe PageLayoutHelper do
end
end
describe 'favicon' do
it 'defaults to favicon.ico' do
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('production'))
expect(helper.favicon).to eq 'favicon.ico'
end
it 'has purple favicon for development' do
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('development'))
expect(helper.favicon).to eq 'favicon-purple.ico'
end
end
describe 'page_image' do
it 'defaults to the GitLab logo' do
expect(helper.page_image).to end_with 'assets/gitlab_logo.png'