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
a8943143
Commit
a8943143
authored
May 08, 2020
by
Tristan Read
Committed by
Stan Hu
May 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show Alerts list when Alert Service is enabled
parent
ea307cd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
app/helpers/projects/alert_management_helper.rb
app/helpers/projects/alert_management_helper.rb
+1
-1
spec/helpers/projects/alert_management_helper_spec.rb
spec/helpers/projects/alert_management_helper_spec.rb
+25
-1
No files found.
app/helpers/projects/alert_management_helper.rb
View file @
a8943143
...
...
@@ -7,7 +7,7 @@ module Projects::AlertManagementHelper
'enable-alert-management-path'
=>
edit_project_service_path
(
project
,
AlertsService
),
'empty-alert-svg-path'
=>
image_path
(
'illustrations/alert-management-empty-state.svg'
),
'user-can-enable-alert-management'
=>
can?
(
current_user
,
:admin_project
,
project
).
to_s
,
'alert-management-enabled'
=>
Feature
.
enabled?
(
:alert_management_minimal
,
project
).
to_s
'alert-management-enabled'
=>
(
!!
project
.
alerts_service_activated?
).
to_s
}
end
...
...
spec/helpers/projects/alert_management_helper_spec.rb
View file @
a8943143
...
...
@@ -13,6 +13,8 @@ describe Projects::AlertManagementHelper do
let
(
:user_can_enable_alert_management
)
{
true
}
let
(
:setting_path
)
{
edit_project_service_path
(
project
,
AlertsService
)
}
subject
(
:data
)
{
helper
.
alert_management_data
(
current_user
,
project
)
}
before
do
allow
(
helper
)
.
to
receive
(
:can?
)
...
...
@@ -27,11 +29,33 @@ describe Projects::AlertManagementHelper do
'enable-alert-management-path'
=>
setting_path
,
'empty-alert-svg-path'
=>
match_asset_path
(
'/assets/illustrations/alert-management-empty-state.svg'
),
'user-can-enable-alert-management'
=>
'true'
,
'alert-management-enabled'
=>
'
tru
e'
'alert-management-enabled'
=>
'
fals
e'
)
end
end
context
'with alerts service'
do
let_it_be
(
:alerts_service
)
{
create
(
:alerts_service
,
project:
project
)
}
context
'when alerts service is active'
do
it
'enables alert management'
do
expect
(
data
).
to
include
(
'alert-management-enabled'
=>
'true'
)
end
end
context
'when alerts service is inactive'
do
it
'disables alert management'
do
alerts_service
.
update
(
active:
false
)
expect
(
data
).
to
include
(
'alert-management-enabled'
=>
'false'
)
end
end
end
context
'when user does not have requisite enablement permissions'
do
let
(
:user_can_enable_alert_management
)
{
false
}
...
...
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