Commit 0b7d8caa authored by Jackie Fraser's avatar Jackie Fraser Committed by Phil Hughes

Fix invite members button showing when signed out

parent 23f945c4
......@@ -25,7 +25,7 @@
title: _("Import members from another project")
- if @project.allowed_to_share_with_group?
.js-invite-group-trigger{ data: { classes: 'gl-mt-3 gl-sm-w-auto gl-w-full gl-sm-ml-3', display_text: _('Invite a group') } }
- if !membership_locked?
- if can_manage_project_members?(@project) && !membership_locked?
.js-invite-members-trigger{ data: { variant: 'success', classes: 'gl-mt-3 gl-sm-w-auto gl-w-full gl-sm-ml-3', display_text: _('Invite members') } }
= render 'projects/invite_members_modal', project: @project
......
......@@ -107,6 +107,20 @@ RSpec.describe 'Project members list', :js do
end
end
context 'as a signed out visitor viewing a public project' do
let_it_be(:project) { create(:project, :public) }
before do
sign_out(user1)
end
it 'does not show the Invite members button when not signed in' do
visit_members_page
expect(page).not_to have_button('Invite members')
end
end
context 'project bots' do
let(:project_bot) { create(:user, :project_bot, name: 'project_bot') }
......
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