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
e6b12029
Commit
e6b12029
authored
Oct 07, 2020
by
Matthew Briedenhann
Committed by
Peter Leitzen
Oct 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang offenses for spec files in spec/support/shared_example/*
parent
f2e77c33
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
19 additions
and
23 deletions
+19
-23
.rubocop_todo.yml
.rubocop_todo.yml
+0
-9
changelogs/unreleased/mb-rails-save-bang-rubcop.yml
changelogs/unreleased/mb-rails-save-bang-rubcop.yml
+5
-0
spec/support/shared_examples/controllers/cache_control_shared_examples.rb
...red_examples/controllers/cache_control_shared_examples.rb
+1
-1
spec/support/shared_examples/controllers/githubish_import_controller_shared_examples.rb
...ontrollers/githubish_import_controller_shared_examples.rb
+1
-1
spec/support/shared_examples/controllers/sessionless_auth_controller_shared_examples.rb
...ontrollers/sessionless_auth_controller_shared_examples.rb
+1
-1
spec/support/shared_examples/features/editable_merge_request_shared_examples.rb
...amples/features/editable_merge_request_shared_examples.rb
+1
-1
spec/support/shared_examples/lib/gitlab/ci/ci_trace_shared_examples.rb
...shared_examples/lib/gitlab/ci/ci_trace_shared_examples.rb
+3
-3
spec/support/shared_examples/quick_actions/issuable/issuable_quick_actions_shared_examples.rb
...ctions/issuable/issuable_quick_actions_shared_examples.rb
+4
-4
spec/support/shared_examples/quick_actions/merge_request/merge_quick_action_shared_examples.rb
...tions/merge_request/merge_quick_action_shared_examples.rb
+1
-1
spec/support/shared_examples/serializers/note_entity_shared_examples.rb
...hared_examples/serializers/note_entity_shared_examples.rb
+2
-2
No files found.
.rubocop_todo.yml
View file @
e6b12029
...
...
@@ -1144,15 +1144,6 @@ Rails/SaveBang:
-
'
spec/support/shared_contexts/email_shared_context.rb'
-
'
spec/support/shared_contexts/finders/group_projects_finder_shared_contexts.rb'
-
'
spec/support/shared_contexts/mailers/notify_shared_context.rb'
-
'
spec/support/shared_examples/controllers/cache_control_shared_examples.rb'
-
'
spec/support/shared_examples/controllers/githubish_import_controller_shared_examples.rb'
-
'
spec/support/shared_examples/controllers/sessionless_auth_controller_shared_examples.rb'
-
'
spec/support/shared_examples/features/editable_merge_request_shared_examples.rb'
-
'
spec/support/shared_examples/lib/gitlab/ci/ci_trace_shared_examples.rb'
-
'
spec/support/shared_examples/policies/project_policy_shared_examples.rb'
-
'
spec/support/shared_examples/quick_actions/issuable/issuable_quick_actions_shared_examples.rb'
-
'
spec/support/shared_examples/quick_actions/merge_request/merge_quick_action_shared_examples.rb'
-
'
spec/support/shared_examples/serializers/note_entity_shared_examples.rb'
-
'
spec/tasks/gitlab/web_hook_rake_spec.rb'
-
'
spec/uploaders/file_uploader_spec.rb'
-
'
spec/uploaders/object_storage_spec.rb'
changelogs/unreleased/mb-rails-save-bang-rubcop.yml
0 → 100644
View file @
e6b12029
---
title
:
Fix Rails/SaveBang offenses for spec files in spec/support/shared_example/*
merge_request
:
44424
author
:
matthewbried
type
:
other
spec/support/shared_examples/controllers/cache_control_shared_examples.rb
View file @
e6b12029
...
...
@@ -2,7 +2,7 @@
RSpec
.
shared_examples
'project cache control headers'
do
before
do
project
.
update
(
visibility_level:
visibility_level
)
project
.
update
!
(
visibility_level:
visibility_level
)
end
context
'when project is public'
do
...
...
spec/support/shared_examples/controllers/githubish_import_controller_shared_examples.rb
View file @
e6b12029
...
...
@@ -262,7 +262,7 @@ RSpec.shared_examples 'a GitHub-ish import controller: POST create' do
context
"when the namespace is owned by the GitLab user"
do
before
do
user
.
username
=
other_username
user
.
save
user
.
save
!
end
it
"takes the existing namespace"
do
...
...
spec/support/shared_examples/controllers/sessionless_auth_controller_shared_examples.rb
View file @
e6b12029
...
...
@@ -44,7 +44,7 @@ RSpec.shared_examples 'authenticates sessionless user' do |path, format, params|
.
to
increment
(
:user_unauthenticated_counter
)
end
personal_access_token
.
update
(
scopes:
[
:read_user
])
personal_access_token
.
update
!
(
scopes:
[
:read_user
])
get
path
,
params:
default_params
.
merge
(
private_token:
personal_access_token
.
token
)
...
...
spec/support/shared_examples/features/editable_merge_request_shared_examples.rb
View file @
e6b12029
...
...
@@ -82,7 +82,7 @@ RSpec.shared_examples 'an editable merge request' do
end
it
'warns about version conflict'
do
merge_request
.
update
(
title:
"New title"
)
merge_request
.
update
!
(
title:
"New title"
)
fill_in
'merge_request_title'
,
with:
'bug 345'
fill_in
'merge_request_description'
,
with:
'bug description'
...
...
spec/support/shared_examples/lib/gitlab/ci/ci_trace_shared_examples.rb
View file @
e6b12029
...
...
@@ -227,7 +227,7 @@ RSpec.shared_examples 'common trace features' do
let
(
:token
)
{
'my_secret_token'
}
before
do
build
.
project
.
update
(
runners_token:
token
)
build
.
project
.
update
!
(
runners_token:
token
)
trace
.
append
(
token
,
0
)
end
...
...
@@ -240,7 +240,7 @@ RSpec.shared_examples 'common trace features' do
let
(
:token
)
{
'my_secret_token'
}
before
do
build
.
update
(
token:
token
)
build
.
update
!
(
token:
token
)
trace
.
append
(
token
,
0
)
end
...
...
@@ -531,7 +531,7 @@ RSpec.shared_examples 'trace with disabled live trace feature' do
context
"when erase old trace with 'save'"
do
before
do
build
.
send
(
:write_attribute
,
:trace
,
nil
)
build
.
save
build
.
save
# rubocop:disable Rails/SaveBang
end
it
'old trace is not deleted'
do
...
...
spec/support/shared_examples/quick_actions/issuable/issuable_quick_actions_shared_examples.rb
View file @
e6b12029
...
...
@@ -109,7 +109,7 @@ RSpec.shared_examples 'issuable quick actions' do
QuickAction
.
new
(
action_text:
"/unlock"
,
before_action:
->
{
issuable
.
update
(
discussion_locked:
true
)
issuable
.
update
!
(
discussion_locked:
true
)
},
expectation:
->
(
noteable
,
can_use_quick_action
)
{
if
can_use_quick_action
...
...
@@ -128,7 +128,7 @@ RSpec.shared_examples 'issuable quick actions' do
QuickAction
.
new
(
action_text:
"/remove_milestone"
,
before_action:
->
{
issuable
.
update
(
milestone_id:
milestone
.
id
)
issuable
.
update
!
(
milestone_id:
milestone
.
id
)
},
expectation:
->
(
noteable
,
can_use_quick_action
)
{
if
can_use_quick_action
...
...
@@ -171,7 +171,7 @@ RSpec.shared_examples 'issuable quick actions' do
QuickAction
.
new
(
action_text:
"/remove_estimate"
,
before_action:
->
{
issuable
.
update
(
time_estimate:
30000
)
issuable
.
update
!
(
time_estimate:
30000
)
},
expectation:
->
(
noteable
,
can_use_quick_action
)
{
if
can_use_quick_action
...
...
@@ -228,7 +228,7 @@ RSpec.shared_examples 'issuable quick actions' do
before
do
project
.
add_developer
(
old_assignee
)
issuable
.
update
(
assignees:
[
old_assignee
])
issuable
.
update
!
(
assignees:
[
old_assignee
])
end
context
'when user can update issuable'
do
...
...
spec/support/shared_examples/quick_actions/merge_request/merge_quick_action_shared_examples.rb
View file @
e6b12029
...
...
@@ -52,7 +52,7 @@ RSpec.shared_examples 'merge quick action' do
context
'when the head diff changes in the meanwhile'
do
before
do
merge_request
.
source_branch
=
'another_branch'
merge_request
.
save
merge_request
.
save
!
sign_in
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
...
...
spec/support/shared_examples/serializers/note_entity_shared_examples.rb
View file @
e6b12029
...
...
@@ -24,7 +24,7 @@ RSpec.shared_examples 'note entity' do
context
'when note was edited'
do
before
do
note
.
update
(
updated_at:
1
.
minute
.
from_now
,
updated_by:
user
)
note
.
update
!
(
updated_at:
1
.
minute
.
from_now
,
updated_by:
user
)
end
it
'exposes last_edited_at and last_edited_by elements'
do
...
...
@@ -34,7 +34,7 @@ RSpec.shared_examples 'note entity' do
context
'when note is a system note'
do
before
do
note
.
update
(
system:
true
)
note
.
update
!
(
system:
true
)
end
it
'exposes system_note_icon_name element'
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