Commit 2ce161f7 authored by Alper Akgun's avatar Alper Akgun

Merge branch '334211-glm-source-content-for-hand-raise-leads' into 'master'

Source & Content for hand raise & trial leads

See merge request gitlab-org/gitlab!72639
parents 2ca18f44 d3d0c431
...@@ -111,13 +111,15 @@ class TrialsController < ApplicationController ...@@ -111,13 +111,15 @@ class TrialsController < ApplicationController
work_email: current_user.email, work_email: current_user.email,
uid: current_user.id, uid: current_user.id,
provider: 'gitlab', provider: 'gitlab',
setup_for_company: current_user.setup_for_company setup_for_company: current_user.setup_for_company,
glm_content: 'group-billing',
glm_source: 'gitlab.com'
} }
end end
def company_params def company_params
params.permit(:company_name, :company_size, :first_name, :last_name, :phone_number, :number_of_users, :country) params.permit(:company_name, :company_size, :first_name, :last_name, :phone_number,
.merge(extra_params) :number_of_users, :country, :glm_content, :glm_source).merge(extra_params)
end end
def extra_params def extra_params
......
...@@ -171,7 +171,9 @@ RSpec.describe TrialsController, :saas do ...@@ -171,7 +171,9 @@ RSpec.describe TrialsController, :saas do
last_name: user.last_name, last_name: user.last_name,
phone_number: '1111111111', phone_number: '1111111111',
number_of_users: '20', number_of_users: '20',
country: 'IN' country: 'IN',
glm_content: 'free-billing',
glm_source: 'about.gitlab.com'
} }
end end
...@@ -188,12 +190,29 @@ RSpec.describe TrialsController, :saas do ...@@ -188,12 +190,29 @@ RSpec.describe TrialsController, :saas do
end end
let(:expected_params) do let(:expected_params) do
ActionController::Parameters.new(post_params).merge(extra_params).permit! {
company_name: 'Gitlab',
company_size: '1-99',
first_name: user.first_name,
last_name: user.last_name,
phone_number: '1111111111',
number_of_users: '20',
country: 'IN',
glm_content: 'free-billing',
glm_source: 'about.gitlab.com',
work_email: user.email,
uid: user.id,
setup_for_company: nil,
skip_email_confirmation: true,
gitlab_com_trial: true,
provider: 'gitlab',
newsletter_segment: user.email_opted_in
}
end end
it 'sends appropriate request params' do it 'sends appropriate request params' do
expect_next_instance_of(GitlabSubscriptions::CreateLeadService) do |lead_service| expect_next_instance_of(GitlabSubscriptions::CreateLeadService) do |lead_service|
expect(lead_service).to receive(:execute).with({ trial_user: expected_params }).and_return({ success: true }) expect(lead_service).to receive(:execute).with({ trial_user: ActionController::Parameters.new(expected_params).permit! }).and_return({ success: true })
end end
post_create_lead post_create_lead
...@@ -211,7 +230,9 @@ RSpec.describe TrialsController, :saas do ...@@ -211,7 +230,9 @@ RSpec.describe TrialsController, :saas do
work_email: user.email, work_email: user.email,
uid: user.id, uid: user.id,
provider: 'gitlab', provider: 'gitlab',
setup_for_company: user.setup_for_company setup_for_company: user.setup_for_company,
glm_content: 'group-billing',
glm_source: 'gitlab.com'
} }
end end
......
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