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
09be61a7
Commit
09be61a7
authored
Jan 20, 2021
by
Małgorzata Ksionek
Committed by
peterhegman
Jan 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for problem described in issue
parent
f4b1e41f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
ee/spec/controllers/groups/group_members_controller_spec.rb
ee/spec/controllers/groups/group_members_controller_spec.rb
+49
-0
No files found.
ee/spec/controllers/groups/group_members_controller_spec.rb
View file @
09be61a7
...
...
@@ -57,6 +57,55 @@ RSpec.describe Groups::GroupMembersController do
enable_external_authorization_service_check
end
describe
'PUT #update'
do
context
'when group has email domain feature enabled'
do
let
(
:email
)
{
'test@gitlab.com'
}
let
(
:member_user
)
{
create
(
:user
,
email:
email
)
}
let
(
:member
)
{
group
.
add_guest
(
member_user
)
}
before
do
stub_licensed_features
(
group_allowed_email_domains:
true
)
create
(
:allowed_email_domain
,
group:
group
)
end
subject
do
put
:update
,
xhr:
true
,
params:
{
group_member:
{
access_level:
50
},
group_id:
group
,
id:
member
}
end
context
'for a user with an email belonging to the allowed domain'
do
it
'returns error status'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
context
'for a user with an un-verified email belonging to a domain different from the allowed domain'
do
let
(
:email
)
{
'test@gmail.com'
}
context
'for a user with an email belonging to the allowed domain'
do
it
'returns error status'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:unprocessable_entity
)
end
it
'returns error message'
do
subject
expect
(
json_response
).
to
eq
({
'message'
=>
"User email 'test@gmail.com' does not match the allowed domains of gitlab.com"
})
end
end
end
end
end
describe
'POST #override'
do
let
(
:group
)
{
create
(
:group_with_ldap_group_link
)
}
...
...
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