summaryrefslogtreecommitdiff
path: root/spec/helpers/appearances_helper_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/appearances_helper_spec.rb')
-rw-r--r--spec/helpers/appearances_helper_spec.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/spec/helpers/appearances_helper_spec.rb b/spec/helpers/appearances_helper_spec.rb
index d972ac27119..edd704ce739 100644
--- a/spec/helpers/appearances_helper_spec.rb
+++ b/spec/helpers/appearances_helper_spec.rb
@@ -80,6 +80,50 @@ RSpec.describe AppearancesHelper do
end
end
+ describe '#brand_header_logo' do
+ let(:options) { {} }
+
+ subject do
+ helper.brand_header_logo(options)
+ end
+
+ context 'with header logo' do
+ let!(:appearance) { create(:appearance, :with_header_logo) }
+
+ it 'renders image tag' do
+ expect(helper).to receive(:image_tag).with(appearance.header_logo_path, class: 'brand-header-logo')
+
+ subject
+ end
+ end
+
+ context 'with add_gitlab_white_text option' do
+ let(:options) { { add_gitlab_white_text: true } }
+
+ it 'renders shared/logo_with_white_text partial' do
+ expect(helper).to receive(:render).with(partial: 'shared/logo_with_white_text', formats: :svg)
+
+ subject
+ end
+ end
+
+ context 'with add_gitlab_black_text option' do
+ let(:options) { { add_gitlab_black_text: true } }
+
+ it 'renders shared/logo_with_black_text partial' do
+ expect(helper).to receive(:render).with(partial: 'shared/logo_with_black_text', formats: :svg)
+
+ subject
+ end
+ end
+
+ it 'renders shared/logo by default' do
+ expect(helper).to receive(:render).with(partial: 'shared/logo', formats: :svg)
+
+ subject
+ end
+ end
+
describe '#brand_title' do
it 'returns the default title when no appearance is present' do
allow(helper).to receive(:current_appearance).and_return(nil)