diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-14 11:41:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-14 11:41:52 +0300 |
commit | 585826cb22ecea5998a2c2a4675735c94bdeedac (patch) | |
tree | 5b05f0b30d33cef48963609e8a18a4dff260eab3 /spec/helpers/application_helper_spec.rb | |
parent | df221d036e5d0c6c0ee4d55b9c97f481ee05dee8 (diff) |
Add latest changes from gitlab-org/gitlab@16-6-stable-eev16.6.0-rc42
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 |