Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Gitlab-External-Templates
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adri
Gitlab-External-Templates
Commits
a5826429
Commit
a5826429
authored
5 years ago
by
Sean Arnold
Browse files
Options
Downloads
Patches
Plain Diff
Stylistic changes to spec files
parent
ec79e109
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ee/spec/lib/gitlab/usage_data_spec.rb
+10
-5
10 additions, 5 deletions
ee/spec/lib/gitlab/usage_data_spec.rb
ee/spec/models/project_spec.rb
+4
-8
4 additions, 8 deletions
ee/spec/models/project_spec.rb
with
14 additions
and
13 deletions
ee/spec/lib/gitlab/usage_data_spec.rb
+
10
−
5
View file @
a5826429
...
...
@@ -272,10 +272,7 @@
end
describe
'auto_issue_creation_projects'
do
subject
{
described_class
.
data
.
dig
(
:counts
,
:projects_auto_issue_creation_enabled
)
}
let!
(
:project
)
{
create
(
:project
)
}
RSpec
.
shared_context
'Prometheus alerts exist'
do
shared_context
'Prometheus alerts exist'
do
before
do
environment
=
create
(
:environment
,
project:
project
)
alert
=
create
(
:prometheus_alert
,
project:
project
,
environment:
environment
)
...
...
@@ -283,6 +280,10 @@
end
end
let
(
:project
)
{
create
(
:project
)
}
subject
{
described_class
.
data
.
dig
(
:counts
,
:projects_auto_issue_creation_enabled
)
}
context
'when incident_management feature is available'
do
before
do
stub_licensed_features
(
incident_management:
true
)
...
...
@@ -302,7 +303,11 @@
context
'with settings set'
do
before
do
create
(
:project_incident_management_setting
,
project:
project
,
create_issue:
setting
)
create
(
:project_incident_management_setting
,
project:
project
,
create_issue:
setting
)
end
context
'with no alert events yet'
do
...
...
This diff is collapsed.
Click to expand it.
ee/spec/models/project_spec.rb
+
4
−
8
View file @
a5826429
...
...
@@ -64,33 +64,29 @@
end
describe
'.with_incident_issue_creation_enabled'
do
subject
{
described_class
.
with_incident_issue_creation_enabled
.
count
}
context
'no incident management settings'
do
it
'returns a project'
do
project
=
create
(
:project
)
expect
(
described_class
.
with_incident_issue_creation_enabled
).
to
include
(
project
)
end
end
context
'with incident management settings'
do
before
do
project
=
create
(
:project
)
create
(
:project_incident_management_setting
,
project:
project
,
create_issue:
enabled
)
end
context
'create_issue turned off'
do
let
(
:enabled
)
{
false
}
it
'does not return a project'
do
expect
(
described_class
.
with_incident_issue_creation_enabled
.
count
).
to
be
0
end
it
{
is_expected
.
to
eq
(
0
)
}
end
context
'create_issue turned on'
do
let
(
:enabled
)
{
true
}
it
'returns a project'
do
expect
(
described_class
.
with_incident_issue_creation_enabled
.
count
).
to
be
1
end
it
{
is_expected
.
to
eq
(
1
)
}
end
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment