diff options
Diffstat (limited to 'spec/helpers/application_helper_spec.rb')
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 7cf64c6e049..d67d07a4f1e 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -637,6 +637,21 @@ RSpec.describe ApplicationHelper do expect(discord).to eq('https://discord.com/users/1234567890123456789') end end + + context 'when mastodon is set' do + let_it_be(:user) { build(:user) } + let(:mastodon) { mastodon_url(user) } + + it 'returns an empty string if mastodon username is not set' do + expect(mastodon).to eq('') + end + + it 'returns mastodon url when mastodon username is set' do + user.mastodon = '@robin@example.com' + + expect(mastodon).to eq(external_redirect_path(url: 'https://example.com/@robin')) + end + end end describe '#gitlab_ui_form_for' do @@ -740,14 +755,6 @@ RSpec.describe ApplicationHelper do it { is_expected.not_to include('with-top-bar') } end end - - describe 'logged-out-marketing-header' do - before do - allow(helper).to receive(:current_user).and_return(nil) - end - - it { is_expected.not_to include('logged-out-marketing-header') } - end end describe '#dispensable_render' do |