Commit 1cf4977d authored by Rubén Dávila's avatar Rubén Dávila

Address suggestions from last code review

Rename method and update specs.
parent 98a45e2b
......@@ -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 }
......
......@@ -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))
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment