Commit d830b385 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'fix-modal-buttons-when-not-signed-in' into 'master'

Fix invite group button showing when signed out

See merge request gitlab-org/gitlab!62320
parents b1bcfe3c 0a841ce6
...@@ -8,7 +8,7 @@ module InviteMembersHelper ...@@ -8,7 +8,7 @@ module InviteMembersHelper
end end
def can_invite_group_for_project?(project) def can_invite_group_for_project?(project)
Feature.enabled?(:invite_members_group_modal, project.group) && project.allowed_to_share_with_group? Feature.enabled?(:invite_members_group_modal, project.group) && can_manage_project_members?(project) && project.allowed_to_share_with_group?
end end
def directly_invite_members? def directly_invite_members?
......
...@@ -32,6 +32,14 @@ RSpec.describe 'Project > Members > Invite group', :js do ...@@ -32,6 +32,14 @@ RSpec.describe 'Project > Members > Invite group', :js do
expect(page).to have_selector(expected_invite_group_selector) expect(page).to have_selector(expected_invite_group_selector)
end end
it 'does not display either the form or the button when visiting the page not signed in' do
project = create(:project, namespace: create(:group))
visit project_project_members_path(project)
expect(page).not_to have_selector(expected_invite_group_selector)
end
end end
describe 'Share with group lock' do describe 'Share with group lock' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment