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
0e50390a
Commit
0e50390a
authored
May 03, 2021
by
Eulyeon Ko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply reviewer suggestions
Use table-based tests
parent
c6a5a456
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
23 deletions
+29
-23
ee/spec/features/boards/user_visits_board_spec.rb
ee/spec/features/boards/user_visits_board_spec.rb
+13
-10
spec/features/boards/user_visits_board_spec.rb
spec/features/boards/user_visits_board_spec.rb
+16
-13
No files found.
ee/spec/features/boards/user_visits_board_spec.rb
View file @
0e50390a
...
...
@@ -3,20 +3,25 @@
require
'spec_helper'
RSpec
.
describe
'User visits issue boards'
,
:js
do
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:group
)
{
create_default
(
:group
,
:public
)
}
let_it_be
(
:project
)
{
create_default
(
:project
,
:public
,
group:
group
)
}
# TODO use 'let' when rspec-parameterized supports it.
# https://gitlab.com/gitlab-org/gitlab/-/issues/329746
assignee_username
=
'root'
label_name
=
'foobar'
scoped_label_name
=
'workflow::in dev'
let_it_be
(
:label
)
{
create
(
:group_label
,
group:
group
,
name:
label_name
)
}
let_it_be
(
:scoped_label
)
{
create
(
:group_label
,
group:
group
,
name:
scoped_label_name
)
}
let_it_be
(
:assignee
)
{
create_default
(
:group_member
,
:maintainer
,
user:
create
(
:user
,
username:
assignee_username
),
group:
group
).
user
}
issue_with_label
=
"issue with label"
issue_with_scoped_label
=
"issue with scoped label"
issue_with_assignee
=
"issue with assignee"
issue_with_all_filters
=
"issue with all filters"
let_it_be
(
:label
)
{
create
(
:group_label
,
group:
group
,
name:
label_name
)
}
let_it_be
(
:scoped_label
)
{
create
(
:group_label
,
group:
group
,
name:
scoped_label_name
)
}
let_it_be
(
:assignee
)
{
create_default
(
:group_member
,
:maintainer
,
user:
create
(
:user
,
username:
assignee_username
),
group:
group
).
user
}
before_all
do
create_default
(
:issue
,
project:
project
,
title:
issue_with_label
,
labels:
[
label
])
create_default
(
:issue
,
project:
project
,
title:
issue_with_scoped_label
,
labels:
[
scoped_label
])
...
...
@@ -48,12 +53,10 @@ RSpec.describe 'User visits issue boards', :js do
end
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
]],
[{
"assignee_username"
=>
assignee_username
},
{
"label_name"
=>
[
label_name
,
scoped_label_name
],
"assignee_username"
=>
assignee_username
},
[
issue_with_all_filters
]]
]
{}
|
{
"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
]
end
with_them
do
...
...
spec/features/boards/user_visits_board_spec.rb
View file @
0e50390a
...
...
@@ -3,22 +3,27 @@
require
'spec_helper'
RSpec
.
describe
'User visits issue boards'
,
:js
do
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:group
)
{
create_default
(
:group
,
:public
)
}
let_it_be
(
:project
)
{
create_default
(
:project
,
:public
,
group:
group
)
}
# TODO use 'let' when rspec-parameterized supports it.
# https://gitlab.com/gitlab-org/gitlab/-/issues/329746
label_name1
=
'foobar'
label_name2
=
'in dev'
assignee_username
=
'root'
let_it_be
(
:label1
)
{
create
(
:group_label
,
group:
group
,
name:
label_name1
)
}
let_it_be
(
:label2
)
{
create
(
:group_label
,
group:
group
,
name:
label_name2
)
}
let_it_be
(
:assignee
)
{
create_default
(
:group_member
,
:maintainer
,
user:
create
(
:user
,
username:
assignee_username
),
group:
group
).
user
}
let_it_be
(
:milestone
)
{
create_default
(
:milestone
,
project:
project
,
start_date:
Date
.
today
-
1
,
due_date:
7
.
days
.
from_now
)
}
issue_with_label1
=
"issue with label1"
issue_with_label2
=
"issue with label2"
issue_with_assignee
=
"issue with assignee"
issue_with_milestone
=
"issue with milestone"
issue_with_all_filters
=
"issue with all filters"
let_it_be
(
:label1
)
{
create
(
:group_label
,
group:
group
,
name:
label_name1
)
}
let_it_be
(
:label2
)
{
create
(
:group_label
,
group:
group
,
name:
label_name2
)
}
let_it_be
(
:assignee
)
{
create_default
(
:group_member
,
:maintainer
,
user:
create
(
:user
,
username:
assignee_username
),
group:
group
).
user
}
let_it_be
(
:milestone
)
{
create_default
(
:milestone
,
project:
project
,
start_date:
Date
.
today
-
1
,
due_date:
7
.
days
.
from_now
)
}
before_all
do
create_default
(
:issue
,
project:
project
,
title:
issue_with_label1
,
labels:
[
label1
])
create_default
(
:issue
,
project:
project
,
title:
issue_with_label2
,
labels:
[
label2
])
...
...
@@ -29,14 +34,12 @@ RSpec.describe 'User visits issue boards', :js do
shared_examples
"visiting board path with search params"
do
where
(
:params
,
:expected_issues
)
do
[
[{
"label_name"
=>
[
label_name1
]
},
[
issue_with_label1
,
issue_with_all_filters
]],
[{
"label_name"
=>
[
label_name2
]
},
[
issue_with_label2
,
issue_with_all_filters
]],
[{
"label_name"
=>
[
label_name1
,
label_name2
]
},
[
issue_with_all_filters
]],
[{
"assignee_username"
=>
assignee_username
},
[
issue_with_assignee
,
issue_with_all_filters
]],
[{
"milestone_title"
=>
'#started'
},
[
issue_with_milestone
,
issue_with_all_filters
]],
[{
"label_name"
=>
[
label_name1
,
label_name2
],
"assignee_username"
=>
assignee_username
},
[
issue_with_all_filters
]]
]
{
"label_name"
=>
[
label_name1
]
}
|
[
issue_with_label1
,
issue_with_all_filters
]
{
"label_name"
=>
[
label_name2
]
}
|
[
issue_with_label2
,
issue_with_all_filters
]
{
"label_name"
=>
[
label_name1
,
label_name2
]
}
|
[
issue_with_all_filters
]
{
"assignee_username"
=>
assignee_username
}
|
[
issue_with_assignee
,
issue_with_all_filters
]
{
"milestone_title"
=>
'#started'
}
|
[
issue_with_milestone
,
issue_with_all_filters
]
{
"label_name"
=>
[
label_name1
,
label_name2
],
"assignee_username"
=>
assignee_username
}
|
[
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