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
1cf4977d
Commit
1cf4977d
authored
Sep 09, 2019
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address suggestions from last code review
Rename method and update specs.
parent
98a45e2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
ee/app/services/gitlab_subscriptions/create_lead_service.rb
ee/app/services/gitlab_subscriptions/create_lead_service.rb
+1
-1
ee/lib/gitlab/subscription_portal/client.rb
ee/lib/gitlab/subscription_portal/client.rb
+1
-1
ee/spec/lib/gitlab/subscription_portal/client_spec.rb
ee/spec/lib/gitlab/subscription_portal/client_spec.rb
+2
-2
No files found.
ee/app/services/gitlab_subscriptions/create_lead_service.rb
View file @
1cf4977d
...
...
@@ -3,7 +3,7 @@
module
GitlabSubscriptions
class
CreateLeadService
def
execute
(
company_params
)
response
=
subscription_app_client
.
create_trial_account
(
company_params
)
response
=
subscription_app_client
.
generate_trial
(
company_params
)
if
response
.
success
{
success:
true
}
...
...
ee/lib/gitlab/subscription_portal/client.rb
View file @
1cf4977d
...
...
@@ -3,7 +3,7 @@
module
Gitlab
module
SubscriptionPortal
class
Client
def
create_trial_account
(
params
)
def
generate_trial
(
params
)
parse_response
(
Gitlab
::
HTTP
.
post
(
"
#{
base_url
}
/trials"
,
body:
params
.
to_json
,
headers:
headers
))
...
...
ee/spec/lib/gitlab/subscription_portal/client_spec.rb
View file @
1cf4977d
...
...
@@ -8,7 +8,7 @@ describe Gitlab::SubscriptionPortal::Client do
let
(
:httparty_response
)
{
double
(
code:
http_response
.
code
,
response:
http_response
,
body:
{}.
to_json
)
}
subject
do
described_class
.
new
.
create_trial_account
({})
described_class
.
new
.
generate_trial
({})
end
context
'when response is successful'
do
...
...
@@ -31,7 +31,7 @@ describe Gitlab::SubscriptionPortal::Client do
end
end
context
'when response code is
generic
'
do
context
'when response code is
500
'
do
let
(
:http_response
)
{
Net
::
HTTPServerError
.
new
(
1.0
,
'500'
,
'Error'
)
}
it
'has a server error status'
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