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
73987067
Commit
73987067
authored
Jun 29, 2020
by
Eugenia Grieff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature specs for group level
Include feature specs for bulk editing health status at a group level
parent
e336d8d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
53 deletions
+84
-53
app/views/shared/issuable/_bulk_update_sidebar.html.haml
app/views/shared/issuable/_bulk_update_sidebar.html.haml
+1
-1
ee/app/views/shared/issuable/_group_bulk_update_sidebar.html.haml
...iews/shared/issuable/_group_bulk_update_sidebar.html.haml
+1
-1
ee/spec/features/issues/bulk_assignment_health_status_spec.rb
...pec/features/issues/bulk_assignment_health_status_spec.rb
+82
-51
No files found.
app/views/shared/issuable/_bulk_update_sidebar.html.haml
View file @
73987067
-
type
=
local_assigns
.
fetch
(
:type
)
-
bulk_issue_health_status_flag
=
Feature
.
enabled?
(
:bulk_update_health_status
)
&&
type
==
:issues
&&
@project
&
.
group
&
.
feature_available?
(
:issuable_health_status
)
-
bulk_issue_health_status_flag
=
Feature
.
enabled?
(
:bulk_update_health_status
,
@project
&
.
group
)
&&
type
==
:issues
&&
@project
&
.
group
&
.
feature_available?
(
:issuable_health_status
)
%aside
.issues-bulk-update.js-right-sidebar.right-sidebar
{
"aria-live"
=>
"polite"
,
data:
{
'signed-in'
:
current_user
.
present?
}
}
.issuable-sidebar.hidden
...
...
ee/app/views/shared/issuable/_group_bulk_update_sidebar.html.haml
View file @
73987067
-
group
=
local_assigns
.
fetch
(
:group
)
-
type
=
local_assigns
.
fetch
(
:type
)
-
bulk_issue_health_status_flag
=
Feature
.
enabled?
(
:bulk_update_health_status
)
&&
type
==
:issues
&&
@project
&
.
group
&
.
feature_available?
(
:issuable_health_status
)
-
bulk_issue_health_status_flag
=
type
==
:issues
&&
Feature
.
enabled?
(
:bulk_update_health_status
,
group
)
&&
group
&
.
feature_available?
(
:issuable_health_status
)
%aside
.issues-bulk-update.js-right-sidebar.right-sidebar
{
'aria-live'
=>
'polite'
,
data:
{
'signed-in'
:
current_user
.
present?
}
}
.issuable-sidebar.hidden
...
...
ee/spec/features/issues/bulk_assignment_health_status_spec.rb
View file @
73987067
...
...
@@ -2,84 +2,110 @@
require
'spec_helper'
describe
'Issues > Health status bulk assignment'
do
RSpec
.
describe
'Issues > Health status bulk assignment'
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
,
:public
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
group:
group
)
}
let_it_be
(
:issue1
)
{
create
(
:issue
,
project:
project
,
title:
"Issue 1"
)
}
let_it_be
(
:issue2
)
{
create
(
:issue
,
project:
project
,
title:
"Issue 2"
)
}
shared_examples
'bulk edit option in sidebar'
do
|
context
|
it
'is present when bulk edit is enabled'
do
enable_bulk_update
(
context
)
expect
(
page
).
to
have_css
(
'.issuable-sidebar'
)
end
it
'is not present when bulk edit is disabled'
do
expect
(
page
).
not_to
have_css
(
'.issuable-sidebar'
)
end
end
shared_examples
'bulk edit health status'
do
|
context
|
before
do
enable_bulk_update
(
context
)
end
context
'health_status'
,
:js
do
context
'to all issues'
do
before
do
check
'check-all-issues'
open_health_status_dropdown
[
'On track'
]
update_issues
end
it
'updates the health statuses'
do
expect
(
issue1
.
reload
.
health_status
).
to
eq
'on_track'
expect
(
issue2
.
reload
.
health_status
).
to
eq
'on_track'
end
end
context
'to an issue'
do
before
do
check
"selected_issue_
#{
issue1
.
id
}
"
open_health_status_dropdown
[
'At risk'
]
update_issues
end
it
'updates the checked issue\'s status'
do
expect
(
issue1
.
reload
.
health_status
).
to
eq
'at_risk'
expect
(
issue2
.
reload
.
health_status
).
to
eq
nil
end
end
end
end
shared_examples
'bulk edit health_status with insufficient permissions'
do
it
'cannot bulk assign health_status'
do
expect
(
page
).
not_to
have_button
'Edit issues'
expect
(
page
).
not_to
have_css
'.check-all-issues'
expect
(
page
).
not_to
have_css
'.issue-check'
end
end
context
'as an allowed user'
,
:js
do
before
do
allow
(
group
).
to
receive
(
:feature_enabled?
).
and_return
(
true
)
stub_licensed_features
(
issuable_health_status:
true
)
stub_licensed_features
(
group_bulk_edit:
true
,
issuable_health_status:
true
)
group
.
add_maintainer
(
user
)
sign_in
user
end
context
'sidebar'
do
it
'is present when bulk edit is enabled'
do
enable_bulk_update
expect
(
page
).
to
have_css
(
'.issuable-sidebar'
)
end
it
'is not present when bulk edit is disabled'
do
expect
(
page
).
not_to
have_css
(
'.issuable-sidebar'
)
end
context
'at group level'
do
it_behaves_like
'bulk edit option in sidebar'
,
:group
it_behaves_like
'bulk edit health status'
,
:group
end
context
'can bulk assign'
do
before
do
enable_bulk_update
end
context
'health_status'
do
context
'to all issues'
do
before
do
check
'check-all-issues'
open_health_status_dropdown
[
'On track'
]
update_issues
end
it
'updates the health statuses'
do
expect
(
issue1
.
reload
.
health_status
).
to
eq
'on_track'
expect
(
issue2
.
reload
.
health_status
).
to
eq
'on_track'
end
end
context
'to a issue'
do
before
do
check
"selected_issue_
#{
issue1
.
id
}
"
open_health_status_dropdown
[
'At risk'
]
update_issues
end
it
'updates the checked issue\'s status'
do
expect
(
issue1
.
reload
.
health_status
).
to
eq
'at_risk'
expect
(
issue2
.
reload
.
health_status
).
to
eq
nil
end
end
end
context
'at project level'
do
it_behaves_like
'bulk edit option in sidebar'
,
:project
it_behaves_like
'bulk edit health status'
,
:project
end
end
context
'as a guest'
do
context
'as a guest'
,
:js
do
before
do
sign_in
user
allow
(
group
).
to
receive
(
:feature_enabled?
).
and_return
(
true
)
stub_licensed_features
(
issuable_health_status:
true
)
end
visit
project_issues_path
(
project
)
context
'at group level'
do
before
do
visit
issues_group_path
(
group
)
end
it_behaves_like
'bulk edit health_status with insufficient permissions'
end
it
'cannot bulk assign health_status'
do
expect
(
page
).
not_to
have_button
'Edit issues'
expect
(
page
).
not_to
have_css
'.check-all-issues'
expect
(
page
).
not_to
have_css
'.issue-check'
context
'at project level'
do
before
do
visit
project_issues_path
(
project
)
end
it_behaves_like
'bulk edit health_status with insufficient permissions'
end
end
...
...
@@ -111,8 +137,13 @@ describe 'Issues > Health status bulk assignment' do
wait_for_requests
end
def
enable_bulk_update
visit
project_issues_path
(
project
)
def
enable_bulk_update
(
context
)
if
context
==
:project
visit
project_issues_path
(
project
)
else
visit
issues_group_path
(
group
)
end
click_button
'Edit issues'
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