diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-20 18:19:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-20 18:19:03 +0300 |
commit | 14bd84b61276ef29b97d23642d698de769bacfd2 (patch) | |
tree | f9eba90140c1bd874211dea17750a0d422c04080 /spec/lib/sidebars/projects/menus/invite_team_members_menu_spec.rb | |
parent | 891c388697b2db0d8ee0c8358a9bdbf6dc56d581 (diff) |
Add latest changes from gitlab-org/gitlab@15-10-stable-eev15.10.0-rc42
Diffstat (limited to 'spec/lib/sidebars/projects/menus/invite_team_members_menu_spec.rb')
-rw-r--r-- | spec/lib/sidebars/projects/menus/invite_team_members_menu_spec.rb | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/spec/lib/sidebars/projects/menus/invite_team_members_menu_spec.rb b/spec/lib/sidebars/projects/menus/invite_team_members_menu_spec.rb deleted file mode 100644 index 9838aa8c3e3..00000000000 --- a/spec/lib/sidebars/projects/menus/invite_team_members_menu_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Sidebars::Projects::Menus::InviteTeamMembersMenu do - let_it_be(:project) { create(:project) } - let_it_be(:guest) { create(:user) } - - let(:context) { Sidebars::Projects::Context.new(current_user: owner, container: project) } - - subject(:invite_menu) { described_class.new(context) } - - context 'when the project is viewed by an owner of the group' do - let(:owner) { project.first_owner } - - describe '#render?' do - it 'renders the Invite team members link' do - expect(invite_menu.render?).to eq(true) - end - - context 'when the project already has at least 2 members' do - before do - project.add_guest(guest) - end - - it 'does not render the link' do - expect(invite_menu.render?).to eq(false) - end - end - end - - describe '#title' do - it 'displays the correct Invite team members text for the link in the side nav' do - expect(invite_menu.title).to eq('Invite members') - end - end - end - - context 'when the project is viewed by a guest user without admin permissions' do - let(:context) { Sidebars::Projects::Context.new(current_user: guest, container: project) } - - before do - project.add_guest(guest) - end - - describe '#render?' do - it 'does not render' do - expect(invite_menu.render?).to eq(false) - end - end - end -end |