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
c3faf68d
Commit
c3faf68d
authored
Sep 21, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
Sep 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang offenses
Fixes Rails/SaveBang cop for spec files in spec/services/issuable/*
parent
60e36e72
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
13 deletions
+15
-13
.rubocop_todo.yml
.rubocop_todo.yml
+0
-3
changelogs/unreleased/rails-save-bang-34.yml
changelogs/unreleased/rails-save-bang-34.yml
+5
-0
spec/services/issuable/bulk_update_service_spec.rb
spec/services/issuable/bulk_update_service_spec.rb
+1
-1
spec/services/issuable/clone/attributes_rewriter_spec.rb
spec/services/issuable/clone/attributes_rewriter_spec.rb
+5
-5
spec/services/issuable/common_system_notes_service_spec.rb
spec/services/issuable/common_system_notes_service_spec.rb
+4
-4
No files found.
.rubocop_todo.yml
View file @
c3faf68d
...
...
@@ -1139,9 +1139,6 @@ Rails/SaveBang:
-
'
spec/services/emails/confirm_service_spec.rb'
-
'
spec/services/groups/destroy_service_spec.rb'
-
'
spec/services/groups/import_export/import_service_spec.rb'
-
'
spec/services/issuable/bulk_update_service_spec.rb'
-
'
spec/services/issuable/clone/attributes_rewriter_spec.rb'
-
'
spec/services/issuable/common_system_notes_service_spec.rb'
-
'
spec/services/labels/promote_service_spec.rb'
-
'
spec/services/notes/create_service_spec.rb'
-
'
spec/services/notification_recipients/build_service_spec.rb'
...
...
changelogs/unreleased/rails-save-bang-34.yml
0 → 100644
View file @
c3faf68d
---
title
:
Fix Rails/SaveBang offenses for spec files in spec/services/issuable/*
merge_request
:
42780
author
:
Rajendra Kadam
type
:
other
spec/services/issuable/bulk_update_service_spec.rb
View file @
c3faf68d
...
...
@@ -254,7 +254,7 @@ RSpec.describe Issuable::BulkUpdateService do
describe
'unsubscribe from issues'
do
let
(
:issues
)
do
create_list
(
:closed_issue
,
2
,
project:
project
)
do
|
issue
|
issue
.
subscriptions
.
create
(
user:
user
,
project:
project
,
subscribed:
true
)
issue
.
subscriptions
.
create
!
(
user:
user
,
project:
project
,
subscribed:
true
)
end
end
...
...
spec/services/issuable/clone/attributes_rewriter_spec.rb
View file @
c3faf68d
...
...
@@ -20,7 +20,7 @@ RSpec.describe Issuable::Clone::AttributesRewriter do
group_label
=
create
(
:group_label
,
title:
'group_label'
,
group:
group
)
create
(
:label
,
title:
'label3'
,
project:
project2
)
original_issue
.
update
(
labels:
[
project1_label_1
,
project1_label_2
,
group_label
])
original_issue
.
update
!
(
labels:
[
project1_label_1
,
project1_label_2
,
group_label
])
subject
.
execute
...
...
@@ -48,7 +48,7 @@ RSpec.describe Issuable::Clone::AttributesRewriter do
it
'sets milestone to nil when old issue milestone is not in the new project'
do
milestone
=
create
(
:milestone
,
title:
'milestone'
,
project:
project1
)
original_issue
.
update
(
milestone:
milestone
)
original_issue
.
update
!
(
milestone:
milestone
)
subject
.
execute
...
...
@@ -59,7 +59,7 @@ RSpec.describe Issuable::Clone::AttributesRewriter do
milestone_project1
=
create
(
:milestone
,
title:
'milestone'
,
project:
project1
)
milestone_project2
=
create
(
:milestone
,
title:
'milestone'
,
project:
project2
)
original_issue
.
update
(
milestone:
milestone_project1
)
original_issue
.
update
!
(
milestone:
milestone_project1
)
subject
.
execute
...
...
@@ -69,7 +69,7 @@ RSpec.describe Issuable::Clone::AttributesRewriter do
it
'copies the milestone when old issue milestone is a group milestone'
do
milestone
=
create
(
:milestone
,
title:
'milestone'
,
group:
group
)
original_issue
.
update
(
milestone:
milestone
)
original_issue
.
update
!
(
milestone:
milestone
)
subject
.
execute
...
...
@@ -85,7 +85,7 @@ RSpec.describe Issuable::Clone::AttributesRewriter do
let!
(
:milestone2_project2
)
{
create
(
:milestone
,
title:
'milestone2'
,
project:
project2
)
}
before
do
original_issue
.
update
(
milestone:
milestone2_project1
)
original_issue
.
update
!
(
milestone:
milestone2_project1
)
create_event
(
milestone1_project1
)
create_event
(
milestone2_project1
)
...
...
spec/services/issuable/common_system_notes_service_spec.rb
View file @
c3faf68d
...
...
@@ -19,7 +19,7 @@ RSpec.describe Issuable::CommonSystemNotesService do
before
do
issuable
.
labels
<<
label
issuable
.
save
issuable
.
save
!
end
it
'creates a resource label event'
do
...
...
@@ -69,7 +69,7 @@ RSpec.describe Issuable::CommonSystemNotesService do
subject
{
described_class
.
new
(
project
,
user
).
execute
(
issuable
,
old_labels:
[],
is_update:
false
)
}
it
'does not create system note for title and description'
do
issuable
.
save
issuable
.
save
!
expect
{
subject
}.
not_to
change
{
issuable
.
notes
.
count
}
end
...
...
@@ -78,7 +78,7 @@ RSpec.describe Issuable::CommonSystemNotesService do
label
=
create
(
:label
,
project:
project
)
issuable
.
labels
<<
label
issuable
.
save
issuable
.
save
!
expect
{
subject
}.
to
change
{
issuable
.
resource_label_events
.
count
}.
from
(
0
).
to
(
1
)
...
...
@@ -104,7 +104,7 @@ RSpec.describe Issuable::CommonSystemNotesService do
it
'creates a system note for due_date set'
do
issuable
.
due_date
=
Date
.
today
issuable
.
save
issuable
.
save
!
expect
{
subject
}.
to
change
{
issuable
.
notes
.
count
}.
from
(
0
).
to
(
1
)
expect
(
issuable
.
notes
.
last
.
note
).
to
match
(
'changed due date'
)
...
...
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