Skip to content
Snippets Groups Projects
Commit 9319af52 authored by Minahil Nichols's avatar Minahil Nichols :three:
Browse files

Add website_url param and clean up feature_spec

parent 64a5143e
No related branches found
No related tags found
1 merge request!82529Create "about your company" page for registration flow
......@@ -41,7 +41,7 @@ export default {
phoneNumber: null,
country: '',
state: '',
website: '',
websiteUrl: '',
};
},
computed: {
......@@ -117,8 +117,13 @@ export default {
pattern="^(\+)*[0-9-\s]+$"
/>
</gl-form-group>
<gl-form-group label="Website (Optional)" label-size="sm" label-for="website">
<gl-form-input id="website" :value="website" name="website" data-testid="website" />
<gl-form-group label="Website (Optional)" label-size="sm" label-for="website_url">
<gl-form-input
id="website_url"
:value="websiteUrl"
name="website_url"
data-testid="website_url"
/>
</gl-form-group>
<gl-form-group label="GitLab Ultimate trial (Optional)" label-size="sm">
<gl-form-text class="gl-pb-3">{{
......
......@@ -132,7 +132,7 @@ def hand_raise_lead_extra_params
def company_params
params.permit(:company_name, :company_size, :first_name, :last_name, :phone_number,
:country, :state, :glm_content, :glm_source).merge(extra_params)
:country, :state, :website_url, :glm_content, :glm_source).merge(extra_params)
end
def extra_params
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Company Information', :js do
......@@ -19,20 +18,38 @@
end
context 'send company information to create lead' do
before do
expect_next_instance_of(GitlabSubscriptions::CreateLeadService) do |service|
expect(service).to receive(:execute).and_return(success: true)
end
end
it 'with all required fields' do
trial_user_params = {
"company_name" => 'GitLab',
"company_size" => '1 - 99'.delete(' '),
"phone_number" => '+1 23 456-78-90',
"country" => 'US',
"state" => '',
"work_email" => user.email,
"uid" => user.id,
"setup_for_company" => user.setup_for_company,
"skip_email_confirmation" => true,
"gitlab_com_trial" => true,
"provider" => "gitlab",
"newsletter_segment" => user.email_opted_in,
"website_url" => 'gitlab.com'
}
lead_params = {
trial_user: ActionController::Parameters.new(trial_user_params).permit!
}
fill_in 'company_name', with: 'GitLab'
select '1 - 99', from: 'company_size'
select 'United States of America', from: 'country'
fill_in 'website_url', with: 'gitlab.com'
fill_in 'phone_number', with: '+1 23 456-78-90'
expect_next_instance_of(GitlabSubscriptions::CreateLeadService) do |service|
expect(service).to receive(:execute).with(lead_params).and_return({ success: true })
end
click_button 'Continue'
end
# TODO: Logic for input validation and end-to-end once trials_controller has a corresponding endpoint
end
end
......@@ -49,7 +49,7 @@ describe('RegistrationForm', () => {
'company_size',
'country',
'phone_number',
'website',
'website_url',
'trial',
];
......
......@@ -1811,6 +1811,9 @@ msgstr ""
msgid "About this feature"
msgstr ""
 
msgid "About your company"
msgstr ""
msgid "Abuse Reports"
msgstr ""
 
......@@ -39420,6 +39423,9 @@ msgstr ""
msgid "Try again?"
msgstr ""
 
msgid "Try all GitLab features for free for 30 days. No credit card required."
msgstr ""
msgid "Try all GitLab has to offer for 30 days."
msgstr ""
 
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment