diff options
Diffstat (limited to 'spec/helpers/appearances_helper_spec.rb')
-rw-r--r-- | spec/helpers/appearances_helper_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/helpers/appearances_helper_spec.rb b/spec/helpers/appearances_helper_spec.rb index 2b0192d24b3..4a32c586315 100644 --- a/spec/helpers/appearances_helper_spec.rb +++ b/spec/helpers/appearances_helper_spec.rb @@ -205,6 +205,30 @@ RSpec.describe AppearancesHelper do end end + describe '#custom_sign_in_description' do + it 'returns an empty string if no custom description is found' do + allow(helper).to receive(:current_appearance).and_return(nil) + allow(Gitlab::CurrentSettings).to receive(:current_application_settings).and_return(nil) + allow(Gitlab::CurrentSettings).to receive(:help_text).and_return(nil) + + expect(helper.custom_sign_in_description).to eq('') + end + + it 'returns a custom description if all the setting options are found' do + allow(helper).to receive(:markdown_field).and_return('1', '2') + allow(helper).to receive(:markdown).and_return('3') + + expect(helper.custom_sign_in_description).to eq('1<br>2<br>3') + end + + it 'returns a custom description if only one setting options is found' do + allow(helper).to receive(:markdown_field).and_return('', '2') + allow(helper).to receive(:markdown).and_return('') + + expect(helper.custom_sign_in_description).to eq('2') + end + end + describe '#brand_header_logo' do let(:options) { {} } |