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
7eed995e
Commit
7eed995e
authored
Jun 17, 2020
by
Ryan Cobb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up specs
parent
9b7e934c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
76 deletions
+5
-76
spec/controllers/projects/metrics_dashboard_controller_spec.rb
...controllers/projects/metrics_dashboard_controller_spec.rb
+0
-71
spec/requests/projects/metrics_dashboard_spec.rb
spec/requests/projects/metrics_dashboard_spec.rb
+5
-5
No files found.
spec/controllers/projects/metrics_dashboard_controller_spec.rb
deleted
100644 → 0
View file @
9b7e934c
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Projects
::
MetricsDashboardController
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:maintainer
)
{
create
(
:user
,
name:
'main-dos'
).
tap
{
|
u
|
project
.
add_maintainer
(
u
)
}
}
let
(
:user
)
{
maintainer
}
let!
(
:environment
)
{
create
(
:environment
,
name:
'production'
,
project:
project
)
}
let!
(
:second_environment
)
{
create
(
:environment
,
name:
'staging'
,
project:
project
)
}
before
do
sign_in
(
user
)
end
describe
'GET d'
do
it
'responds with status code 200'
do
get
:metrics_dashboard_page
,
params:
params
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
it
'assigns default environment'
do
get
:metrics_dashboard_page
,
params:
params
expect
(
assigns
(
:environment
).
id
).
to
eq
(
environment
.
id
)
end
context
'with valid environment parameter'
do
let
(
:valid_environment_params
)
{
params
(
environment:
second_environment
.
id
)
}
it
'responds with status code 200'
do
get
:metrics_dashboard_page
,
params:
valid_environment_params
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
it
'assigns param environment'
do
get
:metrics_dashboard_page
,
params:
valid_environment_params
expect
(
assigns
(
:environment
).
id
).
to
eq
(
second_environment
.
id
)
end
end
context
'with invalid environment parameter'
do
let
(
:invalid_environment_params
)
{
params
(
environment:
9999
)}
it
'responds with 404'
do
get
:metrics_dashboard_page
,
params:
invalid_environment_params
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
context
'with custom dashboard path'
do
it
'responds with status code 200'
do
get
:metrics_dashboard_page
,
params:
params
(
dashboard_path:
'custom_dashboard_path.yml'
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
end
def
params
(
opts
=
{})
opts
.
reverse_merge
({
namespace_id:
project
.
namespace
,
project_id:
project
})
end
end
spec/requests/projects/metrics_dashboard_spec.rb
View file @
7eed995e
...
...
@@ -4,10 +4,10 @@ require 'spec_helper'
describe
'metrics dashboard page'
do
# Further tests can be found at metrics_dashboard_controller_spec.rb
let
(
:project
)
{
create
(
:project
)
}
let
!
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
let
!
(
:environment2
)
{
create
(
:environment
,
project:
project
)
}
let
(
:user
)
{
project
.
owner
}
let
_it_be
(
:project
)
{
create
(
:project
)
}
let
_it_be
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
let
_it_be
(
:environment2
)
{
create
(
:environment
,
project:
project
)
}
let
_it_be
(
:user
)
{
project
.
owner
}
before
do
project
.
add_developer
(
user
)
...
...
@@ -53,7 +53,7 @@ describe 'metrics dashboard page' do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
it
'assigns environment
0
'
do
it
'assigns environment'
do
send_request
(
dashboard_path:
dashboard_path
)
expect
(
assigns
(
:environment
).
id
).
to
eq
(
environment
.
id
)
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