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
6431e85b
Commit
6431e85b
authored
Feb 18, 2022
by
Jason Goodman
Committed by
Imre Farkas
Feb 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Feature Specs for Pending Group and Project Memberships
parent
d82662a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
ee/spec/features/pending_group_memberships_spec.rb
ee/spec/features/pending_group_memberships_spec.rb
+34
-0
ee/spec/features/pending_project_memberships_spec.rb
ee/spec/features/pending_project_memberships_spec.rb
+10
-0
No files found.
ee/spec/features/pending_group_memberships_spec.rb
View file @
6431e85b
...
@@ -34,6 +34,19 @@ RSpec.describe 'Pending group memberships', :js do
...
@@ -34,6 +34,19 @@ RSpec.describe 'Pending group memberships', :js do
expect
(
page
).
not_to
have_content
"Recent activity"
expect
(
page
).
not_to
have_content
"Recent activity"
end
end
it
'a pending member sees a public group with a private project as if not a member'
do
create
(
:project
,
:private
,
namespace:
group
)
create
(
:group_member
,
:awaiting
,
:developer
,
source:
group
,
user:
developer
)
visit
group_path
(
group
)
expect
(
page
).
to
have_content
"Group ID:
#{
group
.
id
}
"
expect
(
page
).
to
have_content
"A group is a collection of several projects"
expect
(
page
).
to
have_content
"No groups or projects matched your search"
expect
(
page
).
not_to
have_content
"New project"
expect
(
page
).
not_to
have_content
"Recent activity"
end
it
'a pending group member gets a 404 for a private project in the group'
do
it
'a pending group member gets a 404 for a private project in the group'
do
project
=
create
(
:project
,
:private
,
namespace:
group
)
project
=
create
(
:project
,
:private
,
namespace:
group
)
create
(
:group_member
,
:awaiting
,
:developer
,
source:
group
,
user:
developer
)
create
(
:group_member
,
:awaiting
,
:developer
,
source:
group
,
user:
developer
)
...
@@ -42,6 +55,18 @@ RSpec.describe 'Pending group memberships', :js do
...
@@ -42,6 +55,18 @@ RSpec.describe 'Pending group memberships', :js do
expect
(
page
).
to
have_content
"Page Not Found"
expect
(
page
).
to
have_content
"Page Not Found"
end
end
it
'a group member can see a private project in the group once the pending membership transitions to active'
do
project
=
create
(
:project
,
:private
,
namespace:
group
)
membership
=
create
(
:group_member
,
:awaiting
,
:developer
,
source:
group
,
user:
developer
)
membership
.
activate!
visit
project_path
(
project
)
expect
(
page
).
to
have_content
project
.
name
expect
(
page
).
to
have_content
"The repository for this project does not exist."
end
end
end
context
'with a private group'
do
context
'with a private group'
do
...
@@ -54,6 +79,15 @@ RSpec.describe 'Pending group memberships', :js do
...
@@ -54,6 +79,15 @@ RSpec.describe 'Pending group memberships', :js do
expect
(
page
).
to
have_content
'Page Not Found'
expect
(
page
).
to
have_content
'Page Not Found'
end
end
it
'a pending member gets a 404 for a private group with a project'
do
create
(
:project
,
namespace:
group
)
create
(
:group_member
,
:awaiting
,
:developer
,
source:
group
,
user:
developer
)
visit
group_path
(
group
)
expect
(
page
).
to
have_content
'Page Not Found'
end
end
end
context
'with a subgroup'
do
context
'with a subgroup'
do
...
...
ee/spec/features/pending_project_memberships_spec.rb
View file @
6431e85b
...
@@ -35,6 +35,16 @@ RSpec.describe 'Pending project memberships', :js do
...
@@ -35,6 +35,16 @@ RSpec.describe 'Pending project memberships', :js do
expect
(
page
).
to
have_content
"Group ID:
#{
group
.
id
}
"
expect
(
page
).
to
have_content
"Group ID:
#{
group
.
id
}
"
expect
(
page
).
to
have_content
project
.
name
expect
(
page
).
to
have_content
project
.
name
end
end
context
'when a pending group membership is created with an existing pending project membership'
do
it
"a pending member gets a 404 for the project's private group"
do
create
(
:group_member
,
:awaiting
,
:developer
,
source:
group
,
user:
developer
)
visit
group_path
(
group
)
expect
(
page
).
to
have_content
"Page Not Found"
end
end
end
end
context
'with a public project in a public group'
do
context
'with a public project in a public group'
do
...
...
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