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
9847a0a9
Commit
9847a0a9
authored
Oct 20, 2020
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cop FactoryBot/InlineAssociation for resource events
parent
a48f8b08
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
8 deletions
+5
-8
.rubocop_todo.yml
.rubocop_todo.yml
+0
-3
spec/factories/resource_label_events.rb
spec/factories/resource_label_events.rb
+1
-1
spec/factories/resource_milestone_event.rb
spec/factories/resource_milestone_event.rb
+2
-2
spec/factories/resource_state_event.rb
spec/factories/resource_state_event.rb
+2
-2
No files found.
.rubocop_todo.yml
View file @
9847a0a9
...
...
@@ -1323,9 +1323,6 @@ FactoryBot/InlineAssociation:
-
'
spec/factories/notes.rb'
-
'
spec/factories/packages.rb'
-
'
spec/factories/packages/package_file.rb'
-
'
spec/factories/resource_label_events.rb'
-
'
spec/factories/resource_milestone_event.rb'
-
'
spec/factories/resource_state_event.rb'
-
'
spec/factories/sent_notifications.rb'
-
'
spec/factories/serverless/domain.rb'
-
'
spec/factories/serverless/domain_cluster.rb'
...
...
spec/factories/resource_label_events.rb
View file @
9847a0a9
...
...
@@ -4,7 +4,7 @@ FactoryBot.define do
factory
:resource_label_event
do
action
{
:add
}
label
user
{
issuable
&
.
author
||
create
(
:user
)
}
user
{
issuable
&
.
author
||
association
(
:user
)
}
after
(
:build
)
do
|
event
,
evaluator
|
event
.
issue
=
create
(
:issue
)
unless
event
.
issuable
...
...
spec/factories/resource_milestone_event.rb
View file @
9847a0a9
...
...
@@ -2,11 +2,11 @@
FactoryBot
.
define
do
factory
:resource_milestone_event
do
issue
{
merge_request
.
nil?
?
create
(
:issue
)
:
nil
}
issue
{
merge_request
.
nil?
?
association
(
:issue
)
:
nil
}
merge_request
{
nil
}
milestone
action
{
:add
}
state
{
:opened
}
user
{
issue
&
.
author
||
merge_request
&
.
author
||
create
(
:user
)
}
user
{
issue
&
.
author
||
merge_request
&
.
author
||
association
(
:user
)
}
end
end
spec/factories/resource_state_event.rb
View file @
9847a0a9
...
...
@@ -2,9 +2,9 @@
FactoryBot
.
define
do
factory
:resource_state_event
do
issue
{
merge_request
.
nil?
?
create
(
:issue
)
:
nil
}
issue
{
merge_request
.
nil?
?
association
(
:issue
)
:
nil
}
merge_request
{
nil
}
state
{
:opened
}
user
{
issue
&
.
author
||
merge_request
&
.
author
||
create
(
:user
)
}
user
{
issue
&
.
author
||
merge_request
&
.
author
||
association
(
:user
)
}
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