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
2c6fdb22
Commit
2c6fdb22
authored
Mar 07, 2018
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove badly merged code
parent
d7910628
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
60 deletions
+0
-60
spec/models/environment_spec.rb
spec/models/environment_spec.rb
+0
-60
No files found.
spec/models/environment_spec.rb
View file @
2c6fdb22
...
...
@@ -483,66 +483,6 @@ describe Environment do
end
end
describe
'#metrics'
do
let
(
:project
)
{
create
(
:prometheus_project
)
}
subject
{
environment
.
metrics
}
context
'when the environment has metrics'
do
before
do
allow
(
environment
).
to
receive
(
:has_metrics?
).
and_return
(
true
)
end
it
'returns the metrics from the deployment service'
do
expect
(
project
.
monitoring_service
)
.
to
receive
(
:environment_metrics
).
with
(
environment
)
.
and_return
(
:fake_metrics
)
is_expected
.
to
eq
(
:fake_metrics
)
end
end
context
'when the environment does not have metrics'
do
before
do
allow
(
environment
).
to
receive
(
:has_metrics?
).
and_return
(
false
)
end
it
{
is_expected
.
to
be_nil
}
end
end
describe
'#has_metrics?'
do
subject
{
environment
.
has_metrics?
}
context
'when the enviroment is available'
do
context
'with a deployment service'
do
let
(
:project
)
{
create
(
:prometheus_project
)
}
context
'and a deployment'
do
let!
(
:deployment
)
{
create
(
:deployment
,
environment:
environment
)
}
it
{
is_expected
.
to
be_truthy
}
end
context
'but no deployments'
do
it
{
is_expected
.
to
be_falsy
}
end
end
context
'without a monitoring service'
do
it
{
is_expected
.
to
be_falsy
}
end
end
context
'when the environment is unavailable'
do
let
(
:project
)
{
create
(
:prometheus_project
)
}
before
do
environment
.
stop
end
it
{
is_expected
.
to
be_falsy
}
end
end
describe
'#metrics'
do
let
(
:project
)
{
create
(
:prometheus_project
)
}
subject
{
environment
.
metrics
}
...
...
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