diff options
Diffstat (limited to 'spec/helpers/appearances_helper_spec.rb')
-rw-r--r-- | spec/helpers/appearances_helper_spec.rb | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/spec/helpers/appearances_helper_spec.rb b/spec/helpers/appearances_helper_spec.rb index 8d717b968dd..b8d131dd47c 100644 --- a/spec/helpers/appearances_helper_spec.rb +++ b/spec/helpers/appearances_helper_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require "spec_helper" describe AppearancesHelper do before do @@ -8,15 +8,15 @@ describe AppearancesHelper do allow(helper).to receive(:current_user).and_return(user) end - describe '#header_message' do - it 'returns nil when header message field is not set' do + describe "#header_message" do + it "returns nil when header message field is not set" do create(:appearance) expect(helper.header_message).to be_nil end - context 'when header message is set' do - it 'includes current message' do + context "when header message is set" do + it "includes current message" do message = "Foo bar" create(:appearance, header_message: message) @@ -25,15 +25,15 @@ describe AppearancesHelper do end end - describe '#footer_message' do - it 'returns nil when footer message field is not set' do + describe "#footer_message" do + it "returns nil when footer message field is not set" do create(:appearance) expect(helper.footer_message).to be_nil end - context 'when footer message is set' do - it 'includes current message' do + context "when footer message is set" do + it "includes current message" do message = "Foo bar" create(:appearance, footer_message: message) @@ -42,35 +42,35 @@ describe AppearancesHelper do end end - describe '#brand_image' do + describe "#brand_image" do let!(:appearance) { create(:appearance, :with_logo) } - context 'when there is a logo' do - it 'returns a path' do - expect(helper.brand_image).to match(%r(img data-src="/uploads/-/system/appearance/.*png)) + context "when there is a logo" do + it "returns a path" do + expect(helper.brand_image).to match(%r{img data-src="/uploads/-/system/appearance/.*png}) end end - context 'when there is a logo but no associated upload' do + context "when there is a logo but no associated upload" do before do # Legacy attachments were not tracked in the uploads table appearance.logo.upload.destroy appearance.reload end - it 'falls back to using the original path' do - expect(helper.brand_image).to match(%r(img data-src="/uploads/-/system/appearance/.*png)) + it "falls back to using the original path" do + expect(helper.brand_image).to match(%r{img data-src="/uploads/-/system/appearance/.*png}) end end end - describe '#brand_title' do - it 'returns the default CE title when no appearance is present' do + describe "#brand_title" do + it "returns the default CE title when no appearance is present" do allow(helper) .to receive(:current_appearance) - .and_return(nil) + .and_return(nil) - expect(helper.brand_title).to eq('GitLab Community Edition') + expect(helper.brand_title).to eq("GitLab Community Edition") end end end |