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
1dcb1197
Commit
1dcb1197
authored
Apr 21, 2021
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return connection error for activation
Use different key to be distinguishable
parent
bc88a28e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
ee/lib/gitlab/subscription_portal/clients/graphql.rb
ee/lib/gitlab/subscription_portal/clients/graphql.rb
+3
-3
ee/spec/lib/gitlab/subscription_portal/clients/graphql_spec.rb
...ec/lib/gitlab/subscription_portal/clients/graphql_spec.rb
+8
-0
No files found.
ee/lib/gitlab/subscription_portal/clients/graphql.rb
View file @
1dcb1197
...
...
@@ -6,6 +6,8 @@ module Gitlab
module
Graphql
extend
ActiveSupport
::
Concern
CONNECTIVITY_ERROR
=
'CONNECTIVITY_ERROR'
class_methods
do
def
activate
(
activation_code
)
uuid
=
Gitlab
::
CurrentSettings
.
uuid
...
...
@@ -33,9 +35,7 @@ module Gitlab
{
query:
query
,
variables:
variables
}
)
if
!
response
[
:success
]
||
response
.
dig
(
:data
,
'errors'
).
present?
return
error
(
response
.
dig
(
:data
,
'errors'
))
end
return
error
(
CONNECTIVITY_ERROR
)
unless
response
[
:success
]
response
=
response
.
dig
(
:data
,
'data'
,
'cloudActivationActivate'
)
...
...
ee/spec/lib/gitlab/subscription_portal/clients/graphql_spec.rb
View file @
1dcb1197
...
...
@@ -49,6 +49,14 @@ RSpec.describe Gitlab::SubscriptionPortal::Clients::Graphql do
expect
(
result
).
to
eq
({
errors:
[
"invalid activation code"
],
success:
false
})
end
it
'returns connectivity error'
do
stub_request
(
:any
,
EE
::
SUBSCRIPTIONS_GRAPHQL_URL
).
to_return
(
status:
[
500
,
"Internal Server Error"
])
result
=
client
.
activate
(
'activation_code_abc'
)
expect
(
result
).
to
eq
({
errors:
described_class
::
CONNECTIVITY_ERROR
,
success:
false
})
end
end
describe
'#plan_upgrade_offer'
do
...
...
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