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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
c40a99a0
Commit
c40a99a0
authored
May 03, 2019
by
James Fargher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change specs to match gitlab code standards
parent
265dee5c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
19 deletions
+23
-19
app/models/clusters/instance.rb
app/models/clusters/instance.rb
+11
-9
spec/controllers/admin/clusters_controller_spec.rb
spec/controllers/admin/clusters_controller_spec.rb
+10
-10
spec/controllers/concerns/enforces_admin_authentication_spec.rb
...ontrollers/concerns/enforces_admin_authentication_spec.rb
+2
-0
No files found.
app/models/clusters/instance.rb
View file @
c40a99a0
# frozen_string_literal: true
# frozen_string_literal: true
class
Clusters::Instance
module
Clusters
def
clusters
class
Instance
Clusters
::
Cluster
.
instance_type
def
clusters
end
Clusters
::
Cluster
.
instance_type
end
def
feature_available?
(
feature
)
def
feature_available?
(
feature
)
::
Feature
.
enabled?
(
feature
,
default_enabled:
true
)
::
Feature
.
enabled?
(
feature
,
default_enabled:
true
)
end
end
def
instance_clusters_enabled?
def
instance_clusters_enabled?
::
Feature
.
enabled?
(
:instance_clusters
,
default_enabled:
true
)
::
Feature
.
enabled?
(
:instance_clusters
,
default_enabled:
true
)
end
end
end
end
end
spec/controllers/admin/clusters_controller_spec.rb
View file @
c40a99a0
...
@@ -12,7 +12,7 @@ describe Admin::ClustersController do
...
@@ -12,7 +12,7 @@ describe Admin::ClustersController do
sign_in
(
admin
)
sign_in
(
admin
)
end
end
describe
'GET index'
do
describe
'GET
#
index'
do
def
get_index
(
params
=
{})
def
get_index
(
params
=
{})
get
:index
,
params:
params
get
:index
,
params:
params
end
end
...
@@ -22,7 +22,7 @@ describe Admin::ClustersController do
...
@@ -22,7 +22,7 @@ describe Admin::ClustersController do
stub_feature_flags
(
instance_clusters:
false
)
stub_feature_flags
(
instance_clusters:
false
)
end
end
it
're
nders 404
'
do
it
're
sponds with not found
'
do
get_index
get_index
expect
(
response
).
to
have_gitlab_http_status
(
404
)
expect
(
response
).
to
have_gitlab_http_status
(
404
)
...
@@ -90,7 +90,7 @@ describe Admin::ClustersController do
...
@@ -90,7 +90,7 @@ describe Admin::ClustersController do
end
end
end
end
describe
'GET new'
do
describe
'GET
#
new'
do
def
get_new
def
get_new
get
:new
get
:new
end
end
...
@@ -166,7 +166,7 @@ describe Admin::ClustersController do
...
@@ -166,7 +166,7 @@ describe Admin::ClustersController do
end
end
end
end
describe
'POST
create for new cluster
'
do
describe
'POST
#create_gcp
'
do
let
(
:legacy_abac_param
)
{
'true'
}
let
(
:legacy_abac_param
)
{
'true'
}
let
(
:params
)
do
let
(
:params
)
do
{
{
...
@@ -251,7 +251,7 @@ describe Admin::ClustersController do
...
@@ -251,7 +251,7 @@ describe Admin::ClustersController do
end
end
end
end
describe
'POST
create for existing clust
er'
do
describe
'POST
#create_us
er'
do
let
(
:params
)
do
let
(
:params
)
do
{
{
cluster:
{
cluster:
{
...
@@ -321,7 +321,7 @@ describe Admin::ClustersController do
...
@@ -321,7 +321,7 @@ describe Admin::ClustersController do
end
end
end
end
describe
'GET cluster_status'
do
describe
'GET
#
cluster_status'
do
let
(
:cluster
)
{
create
(
:cluster
,
:providing_by_gcp
,
:instance
)
}
let
(
:cluster
)
{
create
(
:cluster
,
:providing_by_gcp
,
:instance
)
}
def
get_cluster_status
def
get_cluster_status
...
@@ -354,7 +354,7 @@ describe Admin::ClustersController do
...
@@ -354,7 +354,7 @@ describe Admin::ClustersController do
end
end
end
end
describe
'GET show'
do
describe
'GET
#
show'
do
let
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:instance
)
}
let
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:instance
)
}
def
get_show
def
get_show
...
@@ -365,7 +365,7 @@ describe Admin::ClustersController do
...
@@ -365,7 +365,7 @@ describe Admin::ClustersController do
end
end
describe
'functionality'
do
describe
'functionality'
do
it
're
nders view
'
do
it
're
sponds successfully
'
do
get_show
get_show
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
...
@@ -380,7 +380,7 @@ describe Admin::ClustersController do
...
@@ -380,7 +380,7 @@ describe Admin::ClustersController do
end
end
end
end
describe
'PUT update'
do
describe
'PUT
#
update'
do
def
put_update
(
format: :html
)
def
put_update
(
format: :html
)
put
:update
,
params:
params
.
merge
(
put
:update
,
params:
params
.
merge
(
id:
cluster
,
id:
cluster
,
...
@@ -476,7 +476,7 @@ describe Admin::ClustersController do
...
@@ -476,7 +476,7 @@ describe Admin::ClustersController do
end
end
end
end
describe
'DELETE destroy'
do
describe
'DELETE
#
destroy'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:production_environment
,
:instance
)
}
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:production_environment
,
:instance
)
}
def
delete_destroy
def
delete_destroy
...
...
spec/controllers/concerns/enforces_admin_authentication_spec.rb
View file @
c40a99a0
...
@@ -24,6 +24,7 @@ describe EnforcesAdminAuthentication do
...
@@ -24,6 +24,7 @@ describe EnforcesAdminAuthentication do
it
'renders ok'
do
it
'renders ok'
do
get
:index
get
:index
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
end
end
end
end
...
@@ -31,6 +32,7 @@ describe EnforcesAdminAuthentication do
...
@@ -31,6 +32,7 @@ describe EnforcesAdminAuthentication do
context
'as a user'
do
context
'as a user'
do
it
'renders a 404'
do
it
'renders a 404'
do
get
:index
get
:index
expect
(
response
).
to
have_gitlab_http_status
(
404
)
expect
(
response
).
to
have_gitlab_http_status
(
404
)
end
end
end
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