Commit a9855588 authored by Alper Akgun's avatar Alper Akgun

Hide company question for new account signups

It's a duplicate question
parent 8c7f358a
- page_title _('Start a Free Gold Trial') - page_title _('Start a Free Gold Trial')
- glm_params = { glm_source: params[:glm_source], glm_content: params[:glm_content] } - glm_params = { glm_source: params[:glm_source], glm_content: params[:glm_content] }
- should_ask_company_question = glm_params[:glm_source] != 'about.gitlab.com'
%h3.center.pt-6 %h3.center.pt-6
= _('Almost there') = _('Almost there')
...@@ -16,7 +17,7 @@ ...@@ -16,7 +17,7 @@
#group_name.form-group.hidden #group_name.form-group.hidden
= label_tag :new_group_name, _('New Group Name'), for: :new_group_name, class: 'col-form-label' = label_tag :new_group_name, _('New Group Name'), for: :new_group_name, class: 'col-form-label'
= text_field_tag :new_group_name, nil, class: 'form-control' = text_field_tag :new_group_name, nil, class: 'form-control'
- if current_user.setup_for_company.nil? - if should_ask_company_question
.form-group .form-group
= label_tag :trial_entity, _('Is this GitLab trial for your company?') = label_tag :trial_entity, _('Is this GitLab trial for your company?')
.gl-form-checkbox-group .gl-form-checkbox-group
......
---
title: Hide company question for new account signups
merge_request: 27563
author:
type: changed
...@@ -14,25 +14,23 @@ describe 'Trial Select Namespace', :js do ...@@ -14,25 +14,23 @@ describe 'Trial Select Namespace', :js do
end end
context 'when user' do context 'when user' do
let(:setup_for_company) { nil } let(:url_params) { {} }
before do before do
user.update! setup_for_company: setup_for_company visit select_trials_path(url_params)
visit select_trials_path
wait_for_all_requests wait_for_all_requests
choose :trial_entity_company if setup_for_company.nil? choose :trial_entity_company if url_params[:glm_source] != 'about.gitlab.com'
end end
context 'when setup_for_company is not chosen' do context 'when source is not about.gitlab.com' do
it 'shows company/individual duplicate question' do it 'shows company/individual question' do
expect(page).to have_content('Is this GitLab trial for your company?') expect(page).to have_content('Is this GitLab trial for your company?')
end end
end end
context 'when setup_for_company is already chosen' do context 'when source is about.gitlab.com' do
let(:setup_for_company) { true } let(:url_params) { { glm_source: 'about.gitlab.com' } }
it 'hides company/individual duplicate question' do it 'hides company/individual duplicate question' do
expect(page).not_to have_content('Is this GitLab trial for your company?') expect(page).not_to have_content('Is this GitLab trial for your company?')
......
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