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
913e2654
Commit
913e2654
authored
May 04, 2021
by
Eulyeon Ko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply reviewer suggestions 2
DRY parameters
parent
0e50390a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
ee/spec/features/boards/user_visits_board_spec.rb
ee/spec/features/boards/user_visits_board_spec.rb
+16
-9
No files found.
ee/spec/features/boards/user_visits_board_spec.rb
View file @
913e2654
...
...
@@ -52,11 +52,16 @@ RSpec.describe 'User visits issue boards', :js do
board
.
update!
(
label_ids:
[
label
.
id
,
scoped_label
.
id
])
end
label_params1
=
{
"label_name"
=>
[
label_name
]
}
label_params2
=
{
"label_name"
=>
[
label_name
,
scoped_label_name
]
}
assignee_param
=
{
"assignee_username"
=>
assignee_username
}
combined_params
=
label_params2
.
merge
(
assignee_param
)
where
(
:params
,
:expected_params
,
:expected_issues
)
do
{}
|
{
"label_name"
=>
[
label_name
,
scoped_label_name
]
}
|
[
issue_with_all_filters
]
{
"label_name"
=>
[
label_name
]
}
|
{
"label_name"
=>
[
label_name
,
scoped_label_name
]
}
|
[
issue_with_all_filters
]
{
"label_name"
=>
[
label_name
,
scoped_label_name
]
}
|
{
"label_name"
=>
[
label_name
,
scoped_label_name
]
}
|
[
issue_with_all_filters
]
# rubocop:disable Lint/BinaryOperatorWithIdenticalOperands
{
"assignee_username"
=>
assignee_username
}
|
{
"label_name"
=>
[
label_name
,
scoped_label_name
],
"assignee_username"
=>
assignee_username
}
|
[
issue_with_all_filters
]
{}
|
label_params2
|
[
issue_with_all_filters
]
label_params1
|
label_params2
|
[
issue_with_all_filters
]
label_params2
|
label_params2
|
[
issue_with_all_filters
]
# rubocop:disable Lint/BinaryOperatorWithIdenticalOperands
assignee_param
|
combined_params
|
[
issue_with_all_filters
]
end
with_them
do
...
...
@@ -72,12 +77,14 @@ RSpec.describe 'User visits issue boards', :js do
board
.
update!
(
assignee:
assignee
)
end
scoped_label_param
=
{
"label_name"
=>
[
scoped_label_name
]
}
assignee_param
=
{
"assignee_username"
=>
assignee_username
}
combined_params
=
scoped_label_param
.
merge
(
assignee_param
)
where
(
:params
,
:expected_params
,
:expected_issues
)
do
[
[{},
{
"assignee_username"
=>
assignee_username
},
[
issue_with_assignee
,
issue_with_all_filters
]],
[{
"assignee_username"
=>
assignee_username
},
{
"assignee_username"
=>
assignee_username
},
[
issue_with_assignee
,
issue_with_all_filters
]],
[{
"label_name"
=>
[
scoped_label_name
]
},
{
"assignee_username"
=>
assignee_username
,
"label_name"
=>
[
scoped_label_name
]
},
[
issue_with_all_filters
]]
]
{}
|
assignee_param
|
[
issue_with_assignee
,
issue_with_all_filters
]
assignee_param
|
assignee_param
|
[
issue_with_assignee
,
issue_with_all_filters
]
# rubocop:disable Lint/BinaryOperatorWithIdenticalOperands
scoped_label_param
|
combined_params
|
[
issue_with_all_filters
]
end
with_them
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