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
6998c0b4
Commit
6998c0b4
authored
Mar 07, 2019
by
rpereira2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clear memoization of licensed_feature_available
parent
3c256256
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
ee/spec/services/projects/prometheus/alerts/notify_service_spec.rb
...ervices/projects/prometheus/alerts/notify_service_spec.rb
+7
-6
No files found.
ee/spec/services/projects/prometheus/alerts/notify_service_spec.rb
View file @
6998c0b4
...
...
@@ -9,6 +9,11 @@ describe Projects::Prometheus::Alerts::NotifyService do
let
(
:token_input
)
{
'token'
}
let
(
:subject
)
{
service
.
execute
(
token_input
)
}
before
do
# We use `set(:project)` so we make sure to clear caches
project
.
clear_memoization
(
:licensed_feature_available
)
end
shared_examples
'sends notification email'
do
let
(
:notification_service
)
{
spy
}
...
...
@@ -204,9 +209,7 @@ describe Projects::Prometheus::Alerts::NotifyService do
create
(
:project_alerting_setting
,
project:
project
,
token:
token
)
create
(
:project_incident_management_setting
,
send_email:
true
,
project:
project
)
allow
(
project
).
to
receive
(
:feature_available?
).
and_call_original
allow
(
project
).
to
receive
(
:feature_available?
)
.
with
(
:incident_management
).
and_return
(
false
)
stub_licensed_features
(
incident_management:
false
)
end
it_behaves_like
'persists events'
...
...
@@ -224,9 +227,7 @@ describe Projects::Prometheus::Alerts::NotifyService do
create
(
:prometheus_service
,
project:
project
)
create
(
:project_alerting_setting
,
project:
project
,
token:
token
)
allow
(
project
).
to
receive
(
:feature_available?
).
and_call_original
allow
(
project
).
to
receive
(
:feature_available?
)
.
with
(
:incident_management
).
and_return
(
true
)
stub_licensed_features
(
incident_management:
true
)
end
context
'when incident_management_setting does not exist'
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