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
b6dc6708
Commit
b6dc6708
authored
Jan 18, 2022
by
Fabio Pitino
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue_220040_18' into 'master'
Fix Rails/SaveBang offenses See merge request gitlab-org/gitlab!75988
parents
75232036
2f817b54
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
18 deletions
+12
-18
.rubocop_todo/rails/save_bang.yml
.rubocop_todo/rails/save_bang.yml
+0
-6
spec/lib/gitlab/import_export/uploads_saver_spec.rb
spec/lib/gitlab/import_export/uploads_saver_spec.rb
+2
-2
spec/lib/gitlab/lets_encrypt/client_spec.rb
spec/lib/gitlab/lets_encrypt/client_spec.rb
+1
-1
spec/lib/gitlab/middleware/go_spec.rb
spec/lib/gitlab/middleware/go_spec.rb
+1
-1
spec/lib/gitlab/shard_health_cache_spec.rb
spec/lib/gitlab/shard_health_cache_spec.rb
+3
-3
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+5
-5
No files found.
.rubocop_todo/rails/save_bang.yml
View file @
b6dc6708
...
@@ -50,9 +50,3 @@ Rails/SaveBang:
...
@@ -50,9 +50,3 @@ Rails/SaveBang:
-
spec/lib/gitlab/import_export/snippets_repo_restorer_spec.rb
-
spec/lib/gitlab/import_export/snippets_repo_restorer_spec.rb
-
spec/lib/gitlab/import_export/snippets_repo_saver_spec.rb
-
spec/lib/gitlab/import_export/snippets_repo_saver_spec.rb
-
spec/lib/gitlab/import_export/uploads_manager_spec.rb
-
spec/lib/gitlab/import_export/uploads_manager_spec.rb
-
spec/lib/gitlab/import_export/uploads_saver_spec.rb
-
spec/lib/gitlab/import_export/wiki_restorer_spec.rb
-
spec/lib/gitlab/lets_encrypt/client_spec.rb
-
spec/lib/gitlab/middleware/go_spec.rb
-
spec/lib/gitlab/shard_health_cache_spec.rb
-
spec/mailers/notify_spec.rb
spec/lib/gitlab/import_export/uploads_saver_spec.rb
View file @
b6dc6708
...
@@ -32,7 +32,7 @@ RSpec.describe Gitlab::ImportExport::UploadsSaver do
...
@@ -32,7 +32,7 @@ RSpec.describe Gitlab::ImportExport::UploadsSaver do
end
end
it
'copies the uploads to the export path'
do
it
'copies the uploads to the export path'
do
saver
.
save
saver
.
save
# rubocop:disable Rails/SaveBang
uploads
=
Dir
.
glob
(
File
.
join
(
shared
.
export_path
,
'uploads/**/*'
)).
map
{
|
file
|
File
.
basename
(
file
)
}
uploads
=
Dir
.
glob
(
File
.
join
(
shared
.
export_path
,
'uploads/**/*'
)).
map
{
|
file
|
File
.
basename
(
file
)
}
...
@@ -54,7 +54,7 @@ RSpec.describe Gitlab::ImportExport::UploadsSaver do
...
@@ -54,7 +54,7 @@ RSpec.describe Gitlab::ImportExport::UploadsSaver do
end
end
it
'copies the uploads to the export path'
do
it
'copies the uploads to the export path'
do
saver
.
save
saver
.
save
# rubocop:disable Rails/SaveBang
uploads
=
Dir
.
glob
(
File
.
join
(
shared
.
export_path
,
'uploads/**/*'
)).
map
{
|
file
|
File
.
basename
(
file
)
}
uploads
=
Dir
.
glob
(
File
.
join
(
shared
.
export_path
,
'uploads/**/*'
)).
map
{
|
file
|
File
.
basename
(
file
)
}
...
...
spec/lib/gitlab/lets_encrypt/client_spec.rb
View file @
b6dc6708
...
@@ -42,7 +42,7 @@ RSpec.describe ::Gitlab::LetsEncrypt::Client do
...
@@ -42,7 +42,7 @@ RSpec.describe ::Gitlab::LetsEncrypt::Client do
context
'when private key is saved in settings'
do
context
'when private key is saved in settings'
do
let!
(
:saved_private_key
)
do
let!
(
:saved_private_key
)
do
key
=
OpenSSL
::
PKey
::
RSA
.
new
(
4096
).
to_pem
key
=
OpenSSL
::
PKey
::
RSA
.
new
(
4096
).
to_pem
Gitlab
::
CurrentSettings
.
current_application_settings
.
update
(
lets_encrypt_private_key:
key
)
Gitlab
::
CurrentSettings
.
current_application_settings
.
update
!
(
lets_encrypt_private_key:
key
)
key
key
end
end
...
...
spec/lib/gitlab/middleware/go_spec.rb
View file @
b6dc6708
...
@@ -100,7 +100,7 @@ RSpec.describe Gitlab::Middleware::Go do
...
@@ -100,7 +100,7 @@ RSpec.describe Gitlab::Middleware::Go do
context
'without access to the project'
,
:sidekiq_inline
do
context
'without access to the project'
,
:sidekiq_inline
do
before
do
before
do
project
.
team
.
find_member
(
current_user
).
destroy
project
.
team
.
find_member
(
current_user
).
destroy
!
end
end
it_behaves_like
'unauthorized'
it_behaves_like
'unauthorized'
...
...
spec/lib/gitlab/shard_health_cache_spec.rb
View file @
b6dc6708
...
@@ -6,7 +6,7 @@ RSpec.describe Gitlab::ShardHealthCache, :clean_gitlab_redis_cache do
...
@@ -6,7 +6,7 @@ RSpec.describe Gitlab::ShardHealthCache, :clean_gitlab_redis_cache do
let
(
:shards
)
{
%w(foo bar)
}
let
(
:shards
)
{
%w(foo bar)
}
before
do
before
do
described_class
.
update
(
shards
)
described_class
.
update
(
shards
)
# rubocop:disable Rails/SaveBang
end
end
describe
'.clear'
do
describe
'.clear'
do
...
@@ -24,7 +24,7 @@ RSpec.describe Gitlab::ShardHealthCache, :clean_gitlab_redis_cache do
...
@@ -24,7 +24,7 @@ RSpec.describe Gitlab::ShardHealthCache, :clean_gitlab_redis_cache do
it
'replaces the existing set'
do
it
'replaces the existing set'
do
new_set
=
%w(test me more)
new_set
=
%w(test me more)
described_class
.
update
(
new_set
)
described_class
.
update
(
new_set
)
# rubocop:disable Rails/SaveBang
expect
(
described_class
.
cached_healthy_shards
).
to
match_array
(
new_set
)
expect
(
described_class
.
cached_healthy_shards
).
to
match_array
(
new_set
)
end
end
...
@@ -36,7 +36,7 @@ RSpec.describe Gitlab::ShardHealthCache, :clean_gitlab_redis_cache do
...
@@ -36,7 +36,7 @@ RSpec.describe Gitlab::ShardHealthCache, :clean_gitlab_redis_cache do
end
end
it
'returns 0 if no shards are available'
do
it
'returns 0 if no shards are available'
do
described_class
.
update
([])
described_class
.
update
([])
# rubocop:disable Rails/SaveBang
expect
(
described_class
.
healthy_shard_count
).
to
eq
(
0
)
expect
(
described_class
.
healthy_shard_count
).
to
eq
(
0
)
end
end
...
...
spec/mailers/notify_spec.rb
View file @
b6dc6708
...
@@ -213,7 +213,7 @@ RSpec.describe Notify do
...
@@ -213,7 +213,7 @@ RSpec.describe Notify do
subject
{
described_class
.
issue_due_email
(
recipient
.
id
,
issue
.
id
)
}
subject
{
described_class
.
issue_due_email
(
recipient
.
id
,
issue
.
id
)
}
before
do
before
do
issue
.
update
(
due_date:
Date
.
tomorrow
)
issue
.
update
!
(
due_date:
Date
.
tomorrow
)
end
end
it_behaves_like
'an answer to an existing thread with reply-by-email enabled'
do
it_behaves_like
'an answer to an existing thread with reply-by-email enabled'
do
...
@@ -1229,7 +1229,7 @@ RSpec.describe Notify do
...
@@ -1229,7 +1229,7 @@ RSpec.describe Notify do
end
end
context
'when a comment on an existing discussion'
do
context
'when a comment on an existing discussion'
do
let
(
:first_note
)
{
create
(
model
)
}
let
(
:first_note
)
{
create
(
model
)
}
# rubocop:disable Rails/SaveBang
let
(
:note
)
{
create
(
model
,
author:
note_author
,
noteable:
nil
,
in_reply_to:
first_note
)
}
let
(
:note
)
{
create
(
model
,
author:
note_author
,
noteable:
nil
,
in_reply_to:
first_note
)
}
it
'contains an introduction'
do
it
'contains an introduction'
do
...
@@ -1505,7 +1505,7 @@ RSpec.describe Notify do
...
@@ -1505,7 +1505,7 @@ RSpec.describe Notify do
context
'member is not created by a user'
do
context
'member is not created by a user'
do
before
do
before
do
group_member
.
update
(
created_by:
nil
)
group_member
.
update
!
(
created_by:
nil
)
end
end
it_behaves_like
'no email is sent'
it_behaves_like
'no email is sent'
...
@@ -1513,7 +1513,7 @@ RSpec.describe Notify do
...
@@ -1513,7 +1513,7 @@ RSpec.describe Notify do
context
'member is a known user'
do
context
'member is a known user'
do
before
do
before
do
group_member
.
update
(
user:
create
(
:user
))
group_member
.
update
!
(
user:
create
(
:user
))
end
end
it_behaves_like
'no email is sent'
it_behaves_like
'no email is sent'
...
@@ -1737,7 +1737,7 @@ RSpec.describe Notify do
...
@@ -1737,7 +1737,7 @@ RSpec.describe Notify do
stub_config_setting
(
email_subject_suffix:
'A Nice Suffix'
)
stub_config_setting
(
email_subject_suffix:
'A Nice Suffix'
)
perform_enqueued_jobs
do
perform_enqueued_jobs
do
user
.
email
=
"new-email@mail.com"
user
.
email
=
"new-email@mail.com"
user
.
save
user
.
save
!
end
end
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