Commit baf2eb66 authored by Mike Greiling's avatar Mike Greiling

Merge branch '202095-net-new-saas-trial-sign-ups-are-asked-duplicate-questions' into 'master'

Hide duplicate company/individual question

See merge request gitlab-org/gitlab!24567
parents c58c97cc e504302b
......@@ -16,15 +16,16 @@
#group_name.form-group.hidden
= 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'
.form-group
= label_tag :trial_entity, _('Is this GitLab trial for your company?')
.gl-form-checkbox-group
.gl-form-checkbox.form-check.form-check-inline
= radio_button_tag :trial_entity, :company, params[:trial_entity]=='company', required: true, class: 'form-check-input'
= label_tag :trial_entity_company, _('Yes'), class: 'form-check-label'
.gl-form-checkbox.form-check.form-check-inline
= radio_button_tag :trial_entity, :individual, params[:trial_entity]=='individual', required: true, class: 'form-check-input'
= label_tag :trial_entity_individual, _('No'), class: 'form-check-label'
- if current_user.setup_for_company.nil?
.form-group
= label_tag :trial_entity, _('Is this GitLab trial for your company?')
.gl-form-checkbox-group
.gl-form-checkbox.form-check.form-check-inline
= radio_button_tag :trial_entity, :company, params[:trial_entity]=='company', required: true, class: 'form-check-input'
= label_tag :trial_entity_company, _('Yes'), class: 'form-check-label'
.gl-form-checkbox.form-check.form-check-inline
= radio_button_tag :trial_entity, :individual, params[:trial_entity]=='individual', required: true, class: 'form-check-input'
= label_tag :trial_entity_individual, _('No'), class: 'form-check-label'
= submit_tag _('Start your free trial'), class: 'btn btn-success btn-block'
= render 'skip_trial'
---
title: Hide duplicate company/individual question on trial selection
merge_request: 24567
author:
type: fixed
......@@ -14,12 +14,33 @@ describe 'Trial Select Namespace', :js do
end
context 'when user' do
let(:setup_for_company) { nil }
before do
user.update! setup_for_company: setup_for_company
visit select_trials_path
wait_for_all_requests
choose :trial_entity_company if setup_for_company.nil?
end
context 'when setup_for_company is not chosen' do
it 'shows company/individual duplicate question' do
expect(page).to have_content('Is this GitLab trial for your company?')
end
end
context 'when setup_for_company is already chosen' do
let(:setup_for_company) { true }
it 'hides company/individual duplicate question' do
expect(page).not_to have_content('Is this GitLab trial for your company?')
end
end
context 'selects create a new group' do
before do
visit select_trials_path
wait_for_all_requests
choose :trial_entity_company
select2 '0', from: '#namespace_id'
end
......@@ -98,10 +119,6 @@ describe 'Trial Select Namespace', :js do
context 'selects an existing group' do
before do
visit select_trials_path
wait_for_all_requests
choose :trial_entity_company
select2 user.namespace.id, from: '#namespace_id'
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