diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /spec/helpers/projects_helper_spec.rb | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) | |
download | gitlab-ce-a7b3560714b4d9cc4ab32dffcd1f74a284b93580.tar.gz |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'spec/helpers/projects_helper_spec.rb')
-rw-r--r-- | spec/helpers/projects_helper_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index cc443afee6e..604ce0fe0c1 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -345,6 +345,14 @@ RSpec.describe ProjectsHelper do expect(link).not_to include(user.name) end end + + context 'when user is nil' do + it 'returns "(deleted)"' do + link = helper.link_to_member(project, nil) + + expect(link).to eq("(deleted)") + end + end end describe 'default_clone_protocol' do @@ -1018,4 +1026,26 @@ RSpec.describe ProjectsHelper do end end end + + describe '#import_from_bitbucket_message' do + before do + allow(helper).to receive(:current_user).and_return(user) + end + + context 'as a user' do + it 'returns a link to contact an administrator' do + allow(user).to receive(:admin?).and_return(false) + + expect(helper.import_from_bitbucket_message).to have_text('To enable importing projects from Bitbucket, ask your GitLab administrator to configure OAuth integration') + end + end + + context 'as an administrator' do + it 'returns a link to configure bitbucket' do + allow(user).to receive(:admin?).and_return(true) + + expect(helper.import_from_bitbucket_message).to have_text('To enable importing projects from Bitbucket, as administrator you need to configure OAuth integration') + end + end + end end |