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
1e8dbd52
Commit
1e8dbd52
authored
May 02, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ListGcpProjectsService
parent
45f52235
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
44 deletions
+0
-44
app/services/list_gcp_projects_service.rb
app/services/list_gcp_projects_service.rb
+0
-12
spec/services/list_gcp_projects_service_spec.rb
spec/services/list_gcp_projects_service_spec.rb
+0
-32
No files found.
app/services/list_gcp_projects_service.rb
deleted
100644 → 0
View file @
45f52235
class
ListGcpProjectsService
def
execute
(
token
)
client
=
GoogleApi
::
CloudPlatform
::
Client
.
new
(
token
,
nil
)
# Lists only projects with billing enabled
client
.
projects_list
.
select
do
|
project
|
begin
client
.
projects_get_billing_info
(
project
.
project_id
).
billing_enabled
rescue
end
end
end
end
spec/services/list_gcp_projects_service_spec.rb
deleted
100644 → 0
View file @
45f52235
require
'spec_helper'
describe
ListGcpProjectsService
do
include
GoogleApi
::
CloudPlatformHelpers
let
(
:service
)
{
described_class
.
new
}
let
(
:project_id
)
{
'test-project-1234'
}
describe
'#execute'
do
before
do
stub_cloud_platform_projects_list
(
project_id:
project_id
)
end
subject
{
service
.
execute
(
'bogustoken'
)
}
context
'google account has a billing enabled gcp project'
do
before
do
stub_cloud_platform_projects_get_billing_info
(
project_id
,
true
)
end
it
{
is_expected
.
to
all
(
satisfy
{
|
project
|
project
.
project_id
==
project_id
})
}
end
context
'google account does not have a billing enabled gcp project'
do
before
do
stub_cloud_platform_projects_get_billing_info
(
project_id
,
false
)
end
it
{
is_expected
.
to
eq
([])
}
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