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
abe38ad3
Commit
abe38ad3
authored
Dec 03, 2021
by
Siddharth Asthana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang offenses
Changelog: other EE: true
parent
250783d1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
21 deletions
+18
-21
.rubocop_todo/rails/save_bang.yml
.rubocop_todo/rails/save_bang.yml
+0
-3
ee/spec/lib/ee/gitlab/auth/ldap/sync/group_spec.rb
ee/spec/lib/ee/gitlab/auth/ldap/sync/group_spec.rb
+15
-15
ee/spec/lib/ee/gitlab/checks/push_rules/commit_check_spec.rb
ee/spec/lib/ee/gitlab/checks/push_rules/commit_check_spec.rb
+2
-2
ee/spec/lib/ee/gitlab/ci/pipeline/quota/activity_spec.rb
ee/spec/lib/ee/gitlab/ci/pipeline/quota/activity_spec.rb
+1
-1
No files found.
.rubocop_todo/rails/save_bang.yml
View file @
abe38ad3
...
...
@@ -3,9 +3,6 @@ Rails/SaveBang:
Exclude
:
-
ee/spec/initializers/fog_google_https_private_urls_spec.rb
-
ee/spec/lib/analytics/merge_request_metrics_calculator_spec.rb
-
ee/spec/lib/ee/gitlab/auth/ldap/sync/group_spec.rb
-
ee/spec/lib/ee/gitlab/checks/push_rules/commit_check_spec.rb
-
ee/spec/lib/ee/gitlab/ci/pipeline/quota/activity_spec.rb
-
ee/spec/lib/gitlab/auth/ldap/access_spec.rb
-
ee/spec/lib/gitlab/auth/o_auth/user_spec.rb
-
ee/spec/lib/gitlab/auth/saml/user_spec.rb
...
...
ee/spec/lib/ee/gitlab/auth/ldap/sync/group_spec.rb
View file @
abe38ad3
...
...
@@ -203,7 +203,7 @@ RSpec.describe EE::Gitlab::Auth::Ldap::Sync::Group do
it
'converts an existing membership access request to a real member'
do
group
.
add_owner
(
create
(
:user
))
access_requester
=
group
.
request_access
(
user
)
access_requester
.
update
(
access_level:
::
Gitlab
::
Access
::
MAINTAINER
)
access_requester
.
update
!
(
access_level:
::
Gitlab
::
Access
::
MAINTAINER
)
# Validate that the user is properly created as a requester first.
expect
(
group
.
requesters
.
pluck
(
:id
)).
to
include
(
access_requester
.
id
)
...
...
@@ -246,7 +246,7 @@ RSpec.describe EE::Gitlab::Auth::Ldap::Sync::Group do
end
it
'does not alter an ldap member that has a permission override'
do
group
.
members
.
create
(
group
.
members
.
create
!
(
user:
user
,
access_level:
::
Gitlab
::
Access
::
MAINTAINER
,
ldap:
true
,
...
...
@@ -316,7 +316,7 @@ RSpec.describe EE::Gitlab::Auth::Ldap::Sync::Group do
let
(
:ldap_group1
)
{
ldap_group_entry
(
user_dn
(
user
.
username
))
}
before
do
group
.
update
(
parent:
parent_group
)
group
.
update
!
(
parent:
parent_group
)
parent_group
.
add_maintainer
(
user
)
end
...
...
@@ -337,7 +337,7 @@ RSpec.describe EE::Gitlab::Auth::Ldap::Sync::Group do
end
it
"does not alter an ldap member that has a permission override"
do
group
.
members
.
create
(
group
.
members
.
create
!
(
user:
user
,
access_level:
::
Gitlab
::
Access
::
OWNER
,
ldap:
true
,
...
...
@@ -356,7 +356,7 @@ RSpec.describe EE::Gitlab::Auth::Ldap::Sync::Group do
let
(
:ldap_group1
)
{
ldap_group_entry
(
user_dn
(
user
.
username
))
}
before
do
group
.
update
(
parent:
parent_group
)
group
.
update
!
(
parent:
parent_group
)
parent_group
.
add_reporter
(
user
)
end
...
...
@@ -377,7 +377,7 @@ RSpec.describe EE::Gitlab::Auth::Ldap::Sync::Group do
end
it
"does not alter an ldap member that has a permission override"
do
group
.
members
.
create
(
group
.
members
.
create
!
(
user:
user
,
access_level:
::
Gitlab
::
Access
::
OWNER
,
ldap:
true
,
...
...
@@ -397,17 +397,17 @@ RSpec.describe EE::Gitlab::Auth::Ldap::Sync::Group do
let
(
:access_requester
)
{
parent_group
.
request_access
(
user
)
}
before
do
group
.
update
(
parent:
parent_group
)
group
.
update
!
(
parent:
parent_group
)
parent_group
.
add_owner
(
create
(
:user
))
end
it
'does not propagate the access level of the pending access request'
do
group
.
members
.
create
(
group
.
members
.
create
!
(
user:
user
,
access_level:
::
Gitlab
::
Access
::
DEVELOPER
,
ldap:
true
)
access_requester
.
update
(
access_level:
::
Gitlab
::
Access
::
MAINTAINER
)
access_requester
.
update
!
(
access_level:
::
Gitlab
::
Access
::
MAINTAINER
)
sync_group
.
update_permissions
...
...
@@ -423,7 +423,7 @@ RSpec.describe EE::Gitlab::Auth::Ldap::Sync::Group do
let
(
:ldap_group1
)
{
ldap_group_entry
(
user_dn
(
'other_user'
))
}
before
do
group
.
update
(
parent:
parent_group
)
group
.
update
!
(
parent:
parent_group
)
parent_group
.
add_maintainer
(
user
)
end
...
...
@@ -445,13 +445,13 @@ RSpec.describe EE::Gitlab::Auth::Ldap::Sync::Group do
before
do
group1
.
add_reporter
(
user
)
group2
.
update
(
parent:
group1
)
group2
.
update
!
(
parent:
group1
)
group2
.
add_maintainer
(
user
)
group3
.
update
(
parent:
group2
)
group3
.
update
!
(
parent:
group2
)
# no specific permission for user in group3
group
.
update
(
parent:
group3
)
group
.
update
!
(
parent:
group3
)
end
it
"applies the permission inherited from the closest ancestor when it's higher"
do
...
...
@@ -478,13 +478,13 @@ RSpec.describe EE::Gitlab::Auth::Ldap::Sync::Group do
it
'does not revert the overrides'
do
create
(
:identity
,
user:
user1
,
extern_uid:
user_dn
(
user1
.
username
))
create
(
:identity
,
user:
user2
,
extern_uid:
user_dn
(
user2
.
username
).
upcase
)
group
.
members
.
create
(
group
.
members
.
create
!
(
user:
user1
,
access_level:
::
Gitlab
::
Access
::
MAINTAINER
,
ldap:
true
,
override:
true
)
group
.
members
.
create
(
group
.
members
.
create
!
(
user:
user2
,
access_level:
::
Gitlab
::
Access
::
OWNER
,
ldap:
true
,
...
...
ee/spec/lib/ee/gitlab/checks/push_rules/commit_check_spec.rb
View file @
abe38ad3
...
...
@@ -205,14 +205,14 @@ RSpec.describe EE::Gitlab::Checks::PushRules::CommitCheck do
end
it
'allows the commit when they were done with another email that belongs to the current user'
do
user
.
emails
.
create
(
email:
'secondary_email@user.com'
,
confirmed_at:
Time
.
now
)
user
.
emails
.
create
!
(
email:
'secondary_email@user.com'
,
confirmed_at:
Time
.
now
)
allow_any_instance_of
(
Commit
).
to
receive
(
:committer_email
).
and_return
(
'secondary_email@user.com'
)
expect
{
subject
.
validate!
}.
not_to
raise_error
end
it
'raises an error when the commit was done with an unverified email'
do
user
.
emails
.
create
(
email:
'secondary_email@user.com'
)
user
.
emails
.
create
!
(
email:
'secondary_email@user.com'
)
allow_any_instance_of
(
Commit
).
to
receive
(
:committer_email
).
and_return
(
'secondary_email@user.com'
)
expect
{
subject
.
validate!
}
...
...
ee/spec/lib/ee/gitlab/ci/pipeline/quota/activity_spec.rb
View file @
abe38ad3
...
...
@@ -18,7 +18,7 @@ RSpec.describe EE::Gitlab::Ci::Pipeline::Quota::Activity, :saas do
create
(
:ci_pipeline
,
project:
project
,
status:
'pending'
)
create
(
:ci_pipeline
,
project:
project
,
status:
'running'
)
plan_limits
.
update
(
ci_active_pipelines:
1
)
plan_limits
.
update
!
(
ci_active_pipelines:
1
)
end
end
...
...
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