Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a9e87bb4
Commit
a9e87bb4
authored
Feb 24, 2021
by
Jackie Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ProjectMember access_level_roles for invite members modal
parent
36cf7b9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
8 deletions
+35
-8
app/views/projects/_invite_members_modal.html.haml
app/views/projects/_invite_members_modal.html.haml
+1
-1
spec/features/projects/members/list_spec.rb
spec/features/projects/members/list_spec.rb
+34
-7
No files found.
app/views/projects/_invite_members_modal.html.haml
View file @
a9e87bb4
...
...
@@ -2,6 +2,6 @@
.js-invite-members-modal
{
data:
{
id:
project
.
id
,
name:
project
.
name
,
is_project:
'true'
,
access_levels:
Group
Member
.
access_level_roles
.
to_json
,
access_levels:
Project
Member
.
access_level_roles
.
to_json
,
default_access_level:
Gitlab
::
Access
::
GUEST
,
help_link:
help_page_url
(
'user/permissions'
)
}
}
spec/features/projects/members/list_spec.rb
View file @
a9e87bb4
...
...
@@ -11,7 +11,7 @@ RSpec.describe 'Project members list' do
let
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
before
do
stub_feature_flags
(
invite_members_group_modal:
fals
e
)
stub_feature_flags
(
invite_members_group_modal:
tru
e
)
sign_in
(
user1
)
group
.
add_owner
(
user1
)
...
...
@@ -60,13 +60,30 @@ RSpec.describe 'Project members list' do
it
'add user to project'
,
:js
do
visit_members_page
add_user
(
user2
.
id
,
'Reporter'
)
add_user
(
user2
.
name
,
'Reporter'
)
page
.
within
find_member_row
(
user2
)
do
expect
(
page
).
to
have_button
(
'Reporter'
)
end
end
it
'uses ProjectMember access_level_roles for the invite members modal access option'
,
:js
do
visit_members_page
click_on
'Invite members'
click_on
'Guest'
wait_for_requests
page
.
within
'.dropdown-menu'
do
expect
(
page
).
to
have_button
(
'Guest'
)
expect
(
page
).
to
have_button
(
'Reporter'
)
expect
(
page
).
to
have_button
(
'Developer'
)
expect
(
page
).
to
have_button
(
'Maintainer'
)
expect
(
page
).
not_to
have_button
(
'Owner'
)
end
end
it
'remove user from project'
,
:js
do
other_user
=
create
(
:user
)
project
.
add_developer
(
other_user
)
...
...
@@ -160,7 +177,7 @@ RSpec.describe 'Project members list' do
it
'add user to project'
,
:js
do
visit_members_page
add_user
(
user2
.
id
,
'Reporter'
)
add_user
(
user2
.
name
,
'Reporter'
)
page
.
within
(
second_row
)
do
expect
(
page
).
to
have_content
(
user2
.
name
)
...
...
@@ -222,12 +239,22 @@ RSpec.describe 'Project members list' do
private
def
add_user
(
id
,
role
)
page
.
within
".invite-users-form"
do
select2
(
id
,
from:
"#user_ids"
,
multiple:
true
)
select
(
role
,
from:
"access_level"
)
click_on
'Invite members'
page
.
within
'#invite-members-modal'
do
fill_in
'Search for members to invite'
,
with:
id
wait_for_requests
click_button
id
click_button
'Guest'
wait_for_requests
click_button
role
click_button
'Invite'
end
click_button
"Invite"
page
.
refresh
end
def
visit_members_page
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment