Commit af8c5c88 authored by Nicolas Dular's avatar Nicolas Dular

Cleanup onboarding issues experiment

The onboarding issues experiment added the following features:

- It adds Group and Project creation to the signup flow
- It adds an Experience Level picker to the signup flow
- It creates a learn-gitlab project during the signup flow for the user

It is only targeted to gitlab.com and since it's a big change it's also
rolled out by a default-enabled feature flag.
parent dc847b6a
......@@ -35,7 +35,7 @@ class InvitesController < ApplicationController
def decline
if member.decline_invite!
return render layout: 'devise_experimental_onboarding_issues' if !current_user && member.invite_to_unknown_user? && member.created_by
return render layout: 'signup_onboarding' if !current_user && member.invite_to_unknown_user? && member.created_by
path =
if current_user
......
......@@ -3,7 +3,7 @@
class JiraConnect::UsersController < ApplicationController
feature_category :integrations
layout 'devise_experimental_onboarding_issues'
layout 'signup_onboarding'
def show
@jira_app_link = params.delete(:return_to)
......
......@@ -2,9 +2,8 @@
module Registrations
class ExperienceLevelsController < ApplicationController
layout 'devise_experimental_onboarding_issues'
layout 'signup_onboarding'
before_action :check_experiment_enabled
before_action :ensure_namespace_path_param
feature_category :navigation
......@@ -27,10 +26,6 @@ module Registrations
private
def check_experiment_enabled
access_denied! unless experiment_enabled?(:onboarding_issues)
end
def ensure_namespace_path_param
redirect_to root_path unless params[:namespace_path].present?
end
......
......@@ -16,9 +16,7 @@ module Registrations
result = ::Users::SignupService.new(current_user, update_params).execute
if result[:status] == :success
process_gitlab_com_tracking
return redirect_to new_users_sign_up_group_path if experiment_enabled?(:onboarding_issues) && show_onboarding_issues_experiment?
return redirect_to new_users_sign_up_group_path if show_signup_onboarding?
redirect_to path_for_signed_in_user(current_user)
else
......@@ -36,11 +34,6 @@ module Registrations
current_user.role.present? && !current_user.setup_for_company.nil?
end
def process_gitlab_com_tracking
return false unless ::Gitlab.com?
return false unless show_onboarding_issues_experiment?
end
def update_params
params.require(:user).permit(:role, :other_role, :setup_for_company)
end
......@@ -58,11 +51,8 @@ module Registrations
stored_location_for(user) || dashboard_projects_path
end
def show_onboarding_issues_experiment?
!helpers.in_subscription_flow? &&
!helpers.in_invitation_flow? &&
!helpers.in_oauth_flow? &&
!helpers.in_trial_flow?
def show_signup_onboarding?
false
end
end
end
......
......@@ -9,8 +9,4 @@ export const STEPS = {
export const SUBSCRIPTON_FLOW_STEPS = [STEPS.yourProfile, STEPS.checkout, STEPS.yourGroup];
export const ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS = [
STEPS.yourProfile,
STEPS.yourGroup,
STEPS.yourProject,
];
export const SIGNUP_ONBOARDING_FLOW_STEPS = [STEPS.yourProfile, STEPS.yourGroup, STEPS.yourProject];
......@@ -2,7 +2,7 @@ import Vue from 'vue';
import mountInviteMembers from 'ee/groups/invite';
import mountVisibilityLevelDropdown from '~/groups/visibility_level';
import 'ee/pages/trials/country_select';
import { STEPS, ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS } from '../../constants';
import { STEPS, SIGNUP_ONBOARDING_FLOW_STEPS } from '../../constants';
import ProgressBar from '../../components/progress_bar.vue';
import RegistrationTrialToggle from '../../components/registration_trial_toggle.vue';
......@@ -17,7 +17,7 @@ function mountProgressBar() {
el,
render(createElement) {
return createElement(ProgressBar, {
props: { steps: ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS, currentStep: STEPS.yourGroup },
props: { steps: SIGNUP_ONBOARDING_FLOW_STEPS, currentStep: STEPS.yourGroup },
});
},
});
......
import Vue from 'vue';
import { STEPS, ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS } from '../../constants';
import { STEPS, SIGNUP_ONBOARDING_FLOW_STEPS } from '../../constants';
import ProgressBar from '../../components/progress_bar.vue';
export default () => {
......@@ -11,7 +11,7 @@ export default () => {
el,
render(createElement) {
return createElement(ProgressBar, {
props: { steps: ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS, currentStep: STEPS.yourProject },
props: { steps: SIGNUP_ONBOARDING_FLOW_STEPS, currentStep: STEPS.yourProject },
});
},
});
......
import Vue from 'vue';
import 'ee/registrations/welcome/other_role';
import { parseBoolean } from '~/lib/utils/common_utils';
import {
STEPS,
SUBSCRIPTON_FLOW_STEPS,
ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS,
} from '../constants';
import { STEPS, SUBSCRIPTON_FLOW_STEPS, SIGNUP_ONBOARDING_FLOW_STEPS } from '../constants';
import ProgressBar from '../components/progress_bar.vue';
export default () => {
......@@ -14,16 +10,14 @@ export default () => {
if (!el) return null;
const isInSubscriptionFlow = parseBoolean(el.dataset.isInSubscriptionFlow);
const isOnboardingIssuesExperimentEnabled = parseBoolean(
el.dataset.isOnboardingIssuesExperimentEnabled,
);
const isSignupOnboardingEnabled = parseBoolean(el.dataset.isSignupOnboardingEnabled);
let steps;
if (isInSubscriptionFlow) {
steps = SUBSCRIPTON_FLOW_STEPS;
} else if (isOnboardingIssuesExperimentEnabled) {
steps = ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS;
} else if (isSignupOnboardingEnabled) {
steps = SIGNUP_ONBOARDING_FLOW_STEPS;
}
return new Vue({
......
......@@ -29,6 +29,15 @@ module EE
clean_params
end
override :show_signup_onboarding?
def show_signup_onboarding?
!helpers.in_subscription_flow? &&
!helpers.in_invitation_flow? &&
!helpers.in_oauth_flow? &&
!helpers.in_trial_flow? &&
helpers.signup_onboarding_enabled?
end
def learn_gitlab_project
::Project.find(params[:learn_gitlab_project_id])
end
......
......@@ -6,8 +6,8 @@ module Registrations
layout 'checkout'
before_action :check_signup_onboarding_enabled
before_action :authorize_create_group!, only: :new
before_action :check_experiment_enabled
feature_category :navigation
......@@ -57,12 +57,12 @@ module Registrations
private
def authorize_create_group!
access_denied! unless can?(current_user, :create_group)
def check_signup_onboarding_enabled
access_denied! unless helpers.signup_onboarding_enabled?
end
def check_experiment_enabled
access_denied! unless experiment_enabled?(:onboarding_issues)
def authorize_create_group!
access_denied! unless can?(current_user, :create_group)
end
def group_params
......
......@@ -4,7 +4,7 @@ module Registrations
class ProjectsController < ApplicationController
layout 'checkout'
before_action :check_experiment_enabled
before_action :check_signup_onboarding_enabled
before_action :find_namespace, only: :new
feature_category :navigation
......@@ -38,6 +38,10 @@ module Registrations
private
def check_signup_onboarding_enabled
access_denied! unless helpers.signup_onboarding_enabled?
end
def create_learn_gitlab_project
title, filename = if helpers.in_trial_onboarding_flow?
[s_('Learn GitLab - Ultimate trial'), 'learn_gitlab_gold_trial.tar.gz']
......@@ -59,10 +63,6 @@ module Registrations
learn_gitlab_project
end
def check_experiment_enabled
access_denied! unless experiment_enabled?(:onboarding_issues)
end
def find_namespace
@namespace = Namespace.find_by_id(params[:namespace_id])
......
......@@ -42,7 +42,7 @@ module EE
return true if in_subscription_flow?
return false if in_invitation_flow? || in_oauth_flow? || in_trial_flow?
onboarding_issues_experiment_enabled?
signup_onboarding_enabled?
end
def welcome_submit_button_text
......@@ -52,13 +52,13 @@ module EE
return continue if in_subscription_flow? || in_trial_flow?
return get_started if in_invitation_flow? || in_oauth_flow?
onboarding_issues_experiment_enabled? ? continue : get_started
signup_onboarding_enabled? ? continue : get_started
end
def data_attributes_for_progress_bar_js_component
{
is_in_subscription_flow: in_subscription_flow?.to_s,
is_onboarding_issues_experiment_enabled: onboarding_issues_experiment_enabled?.to_s
is_signup_onboarding_enabled: signup_onboarding_enabled?.to_s
}
end
......@@ -66,10 +66,8 @@ module EE
current_user.members.any?
end
private
def onboarding_issues_experiment_enabled?
experiment_enabled?(:onboarding_issues)
def signup_onboarding_enabled?
::Gitlab.dev_env_or_com? && ::Feature.enabled?(:signup_onboarding, default_enabled: true)
end
end
end
---
name: onboarding_issues_experiment_percentage
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/31656/
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/224515
milestone: '13.0'
type: experiment
name: signup_onboarding
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52905
rollout_issue_url:
milestone: '13.9'
type: development
group: group::conversion
default_enabled: true
......@@ -26,6 +26,8 @@ RSpec.describe Registrations::GroupsController do
end
describe 'GET #new' do
let(:signup_onboarding_enabled) { true }
subject { get :new }
context 'with an unauthenticated user' do
......@@ -36,7 +38,7 @@ RSpec.describe Registrations::GroupsController do
context 'with an authenticated user' do
before do
sign_in(user)
stub_experiment_for_subject(onboarding_issues: true)
allow(controller.helpers).to receive(:signup_onboarding_enabled?).and_return(signup_onboarding_enabled)
end
it { is_expected.to have_gitlab_http_status(:ok) }
......@@ -61,10 +63,8 @@ RSpec.describe Registrations::GroupsController do
it { is_expected.to have_gitlab_http_status(:not_found) }
end
context 'with the experiment not enabled for user' do
before do
stub_experiment_for_subject(onboarding_issues: false)
end
context 'signup onboarding not enabled' do
let(:signup_onboarding_enabled) { false }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
......@@ -78,6 +78,7 @@ RSpec.describe Registrations::GroupsController do
let_it_be(:trial_form_params) { { trial: 'false' } }
let_it_be(:trial_onboarding_issues_enabled) { false }
let_it_be(:trial_onboarding_flow_params) { {} }
let(:signup_onboarding_enabled) { true }
let(:group_params) { { name: 'Group name', path: 'group-path', visibility_level: Gitlab::VisibilityLevel::PRIVATE, emails: ['', ''] } }
let(:params) do
{ group: group_params }.merge(glm_params).merge(trial_form_params).merge(trial_onboarding_flow_params)
......@@ -93,7 +94,8 @@ RSpec.describe Registrations::GroupsController do
context 'with an authenticated user' do
before do
sign_in(user)
stub_experiment_for_subject(onboarding_issues: true, trial_onboarding_issues: trial_onboarding_issues_enabled)
stub_experiment_for_subject(trial_onboarding_issues: trial_onboarding_issues_enabled)
allow(controller.helpers).to receive(:signup_onboarding_enabled?).and_return(signup_onboarding_enabled)
end
it 'creates a group' do
......@@ -162,7 +164,6 @@ RSpec.describe Registrations::GroupsController do
end
before do
allow(controller).to receive(:experiment_enabled?).with(:onboarding_issues).and_call_original
allow(controller).to receive(:experiment_enabled?).with(:trial_during_signup).and_return(true)
end
......@@ -258,6 +259,12 @@ RSpec.describe Registrations::GroupsController do
it { is_expected.to have_gitlab_http_status(:ok) }
it { is_expected.to render_template(:new) }
context 'signup onboarding not enabled' do
let(:signup_onboarding_enabled) { false }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
context 'when the trial onboarding is active' do
let_it_be(:group) { create(:group) }
let_it_be(:trial_onboarding_flow_params) { { trial_onboarding_flow: true } }
......@@ -267,14 +274,6 @@ RSpec.describe Registrations::GroupsController do
it { is_expected.to render_template(:new) }
end
end
context 'with the experiment not enabled for user' do
before do
stub_experiment_for_subject(onboarding_issues: false)
end
it { is_expected.to have_gitlab_http_status(:not_found) }
end
end
end
end
......@@ -15,9 +15,11 @@ RSpec.describe Registrations::ProjectsController do
end
context 'with an authenticated user' do
let(:signup_onboarding_enabled) { true }
before do
sign_in(user)
stub_experiment_for_subject(onboarding_issues: true)
allow(controller.helpers).to receive(:signup_onboarding_enabled?).and_return(signup_onboarding_enabled)
end
it { is_expected.to have_gitlab_http_status(:not_found) }
......@@ -37,10 +39,8 @@ RSpec.describe Registrations::ProjectsController do
end
end
context 'with the experiment not enabled for user' do
before do
stub_experiment_for_subject(onboarding_issues: false)
end
context 'with signup onboarding not enabled' do
let(:signup_onboarding_enabled) { false }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
......@@ -52,6 +52,7 @@ RSpec.describe Registrations::ProjectsController do
let_it_be(:trial_onboarding_flow_params) { {} }
let(:params) { { namespace_id: namespace.id, name: 'New project', path: 'project-path', visibility_level: Gitlab::VisibilityLevel::PRIVATE } }
let(:signup_onboarding_enabled) { true }
context 'with an unauthenticated user' do
it { is_expected.to have_gitlab_http_status(:redirect) }
......@@ -59,12 +60,13 @@ RSpec.describe Registrations::ProjectsController do
end
context 'with an authenticated user', :sidekiq_inline do
let_it_be(:trial_onboarding_issues_enabled) { false }
let_it_be(:trial_onboarding_issues_enabled) { true }
before do
namespace.add_owner(user)
sign_in(user)
stub_experiment_for_subject(onboarding_issues: true, trial_onboarding_issues: trial_onboarding_issues_enabled)
stub_experiment_for_subject(trial_onboarding_issues: trial_onboarding_issues_enabled)
allow(controller.helpers).to receive(:signup_onboarding_enabled?).and_return(signup_onboarding_enabled)
end
it 'creates a new project, a "Learn GitLab" project, sets a cookie and redirects to the experience level page' do
......@@ -112,10 +114,8 @@ RSpec.describe Registrations::ProjectsController do
it { is_expected.to render_template(:new) }
end
context 'with the experiment not enabled for user' do
before do
stub_experiment_for_subject(onboarding_issues: false)
end
context 'with signup onboarding not enabled' do
let(:signup_onboarding_enabled) { false }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
......
......@@ -108,11 +108,17 @@ RSpec.describe Registrations::WelcomeController do
end
describe 'redirection' do
it { is_expected.to redirect_to dashboard_projects_path }
context 'when signup_onboarding is not enabled' do
before do
allow(controller.helpers).to receive(:signup_onboarding_enabled?).and_return(false)
end
it { is_expected.to redirect_to dashboard_projects_path }
end
context 'when part of the onboarding issues experiment' do
context 'when signup_onboarding is enabled' do
before do
stub_experiment_for_subject(onboarding_issues: true)
allow(controller.helpers).to receive(:signup_onboarding_enabled?).and_return(true)
end
it { is_expected.to redirect_to new_users_sign_up_group_path }
......
......@@ -8,8 +8,8 @@ RSpec.describe 'User sees new onboarding flow', :js do
before do
allow(Gitlab).to receive(:com?).and_return(true)
stub_experiment(onboarding_issues: true, trial_during_signup: true)
stub_experiment_for_subject(onboarding_issues: true, trial_during_signup: true)
stub_experiment(trial_during_signup: true)
stub_experiment_for_subject(trial_during_signup: true)
sign_in(user)
visit users_sign_up_welcome_path
......
......@@ -5,7 +5,6 @@ require 'spec_helper'
RSpec.describe 'User sees new onboarding flow', :js do
before do
stub_const('Gitlab::QueryLimiting::Transaction::THRESHOLD', 200)
stub_experiment_for_subject(onboarding_issues: true)
allow(Gitlab).to receive(:com?).and_return(true)
gitlab_sign_in(:user)
visit users_sign_up_welcome_path
......
......@@ -5,10 +5,10 @@ require 'spec_helper'
RSpec.describe 'Welcome screen', :js do
let_it_be(:user) { create(:user) }
let(:signup_onboarding_enabled) { true }
let(:in_invitation_flow) { false }
let(:in_subscription_flow) { false }
let(:in_trial_flow) { false }
let(:part_of_onboarding_issues_experiment) { false }
describe 'on GitLab.com' do
before do
......@@ -17,14 +17,15 @@ RSpec.describe 'Welcome screen', :js do
allow_any_instance_of(EE::WelcomeHelper).to receive(:in_invitation_flow?).and_return(in_invitation_flow)
allow_any_instance_of(EE::WelcomeHelper).to receive(:in_subscription_flow?).and_return(in_subscription_flow)
allow_any_instance_of(EE::WelcomeHelper).to receive(:in_trial_flow?).and_return(in_trial_flow)
stub_experiment_for_subject(onboarding_issues: part_of_onboarding_issues_experiment)
stub_feature_flags(signup_onboarding: signup_onboarding_enabled)
visit users_sign_up_welcome_path
end
it 'shows the welcome page without a progress bar' do
it 'shows the welcome page with a progress bar' do
expect(page).to have_content('Welcome to GitLab')
expect(page).not_to have_content('Your profile')
expect(page).to have_content('Your profile Your GitLab group Your first project')
expect(page).to have_content('Continue')
end
context 'when in the subscription flow' do
......@@ -35,27 +36,28 @@ RSpec.describe 'Welcome screen', :js do
end
end
context 'when part of the onboarding issues experiment' do
let(:part_of_onboarding_issues_experiment) { true }
context 'when in the invitation flow' do
let(:in_invitation_flow) { true }
it 'shows the progress bar with the correct steps' do
expect(page).to have_content('Your profile Your GitLab group Your first project')
it 'does not show the progress bar' do
expect(page).not_to have_content('Your profile')
end
end
context 'when in the invitation flow' do
let(:in_invitation_flow) { true }
context 'when in the trial flow' do
let(:in_trial_flow) { true }
it 'does not show the progress bar' do
expect(page).not_to have_content('Your profile')
end
it 'does not show the progress bar' do
expect(page).not_to have_content('Your profile')
end
end
context 'when in the trial flow' do
let(:in_trial_flow) { true }
context 'when onboarding_signup is disabled' do
let(:signup_onboarding_enabled) { false }
it 'does not show the progress bar' do
expect(page).not_to have_content('Your profile')
end
it 'does not show the progress bar' do
expect(page).not_to have_content('Your profile')
expect(page).to have_content('Get started!')
end
end
end
......
......@@ -30,7 +30,7 @@ RSpec.describe 'Signup on EE' do
select 'Software Developer', from: 'user_role'
choose 'user_setup_for_company_true'
click_button 'Get started!'
click_button 'Continue'
user = User.find_by_username!(new_user[:username])
expect(user.email_opted_in).to be_truthy
......@@ -48,7 +48,7 @@ RSpec.describe 'Signup on EE' do
select 'Software Developer', from: 'user_role'
choose 'user_setup_for_company_false'
check 'user_email_opted_in'
click_button 'Get started!'
click_button 'Continue'
user = User.find_by_username!(new_user[:username])
expect(user.email_opted_in).to be_truthy
......@@ -65,7 +65,7 @@ RSpec.describe 'Signup on EE' do
select 'Software Developer', from: 'user_role'
choose 'user_setup_for_company_false'
click_button 'Get started!'
click_button 'Continue'
user = User.find_by_username!(new_user[:username])
expect(user.email_opted_in).to be_falsey
......@@ -88,7 +88,7 @@ RSpec.describe 'Signup on EE' do
select 'Other', from: 'user_role'
expect(page).not_to have_field('What is your job title? (optional)')
choose 'user_setup_for_company_false'
click_button 'Get started!'
click_button 'Continue'
user = User.find_by_username!(new_user[:username])
expect(user.other_role).to be_blank
......@@ -109,7 +109,7 @@ RSpec.describe 'Signup on EE' do
select 'Software Developer', from: 'user_role'
choose 'user_setup_for_company_false'
click_button 'Get started!'
click_button 'Continue'
user = User.find_by_username!(new_user[:username])
expect(user.other_role).to be_blank
......@@ -133,14 +133,14 @@ RSpec.describe 'Signup on EE' do
choose 'user_setup_for_company_false'
fill_in 'What is your job title? (optional)', with: job_title
click_button 'Get started!'
click_button 'Continue'
user = User.find_by_username!(new_user[:username])
expect(user.other_role).to eq(job_title)
end
end
it 'redirects to step 2 of the signup process, sets the role and setup for company and redirects back' do
it 'redirects to step 2 of the signup process when not completed' do
fill_in_signup_form
click_button 'Register'
visit new_project_path
......@@ -149,12 +149,11 @@ RSpec.describe 'Signup on EE' do
select 'Software Developer', from: 'user_role'
choose 'user_setup_for_company_true'
click_button 'Get started!'
click_button 'Continue'
user = User.find_by_username(new_user[:username])
expect(user.software_developer_role?).to be_truthy
expect(user.setup_for_company).to be_truthy
expect(page).to have_current_path(new_project_path)
end
end
......@@ -176,5 +175,18 @@ RSpec.describe 'Signup on EE' do
expect(user.email_opted_in_source).to be_blank
expect(user.email_opted_in_at).to be_nil
end
it 'redirects to step 2 of the signup process when not completed and redirects back' do
fill_in_signup_form
click_button 'Register'
visit new_project_path
expect(page).to have_current_path(users_sign_up_welcome_path)
select 'Software Developer', from: 'user_role'
click_button 'Get started!'
expect(page).to have_current_path(new_project_path)
end
end
end
......@@ -104,17 +104,17 @@ RSpec.describe EE::WelcomeHelper do
end
end
shared_context 'with the onboarding issues experiment' do
let(:onboarding_issues_experiment_enabled) { false }
shared_context 'with signup onboarding' do
let(:signup_onboarding_enabled) { false }
before do
allow(helper).to receive(:onboarding_issues_experiment_enabled?).and_return(onboarding_issues_experiment_enabled)
allow(helper).to receive(:signup_onboarding_enabled?).and_return(signup_onboarding_enabled)
end
end
describe '#show_signup_flow_progress_bar?' do
include_context 'with the various user flows'
include_context 'with the onboarding issues experiment'
include_context 'with signup onboarding'
subject { helper.show_signup_flow_progress_bar? }
......@@ -128,8 +128,8 @@ RSpec.describe EE::WelcomeHelper do
end
with_them do
context 'regardless of if the onboarding issues experiment is enabled' do
where(onboarding_issues_experiment_enabled: [true, false])
context 'regardless of signup onboarding' do
where(signup_onboarding_enabled: [true, false])
with_them do
it { is_expected.to be_truthy }
......@@ -147,8 +147,8 @@ RSpec.describe EE::WelcomeHelper do
end
with_them do
context 'regardless of if the onboarding issues experiment is enabled' do
where(onboarding_issues_experiment_enabled: [true, false])
context 'regardless of signup onboarding' do
where(signup_onboarding_enabled: [true, false])
with_them do
it { is_expected.to be_falsey }
......@@ -158,13 +158,13 @@ RSpec.describe EE::WelcomeHelper do
end
context 'and not in the invitation, oauth, or trial flow' do
where(:onboarding_issues_experiment_enabled, :result) do
where(:signup_onboarding_enabled, :result) do
true | true
false | false
end
with_them do
it 'depends on whether or not the onboarding issues experiment is enabled' do
it 'depends on whether or not signup onboarding is enabldd' do
is_expected.to eq(result)
end
end
......@@ -174,7 +174,7 @@ RSpec.describe EE::WelcomeHelper do
describe '#welcome_submit_button_text' do
include_context 'with the various user flows'
include_context 'with the onboarding issues experiment'
include_context 'with signup onboarding'
subject { helper.welcome_submit_button_text }
......@@ -185,8 +185,8 @@ RSpec.describe EE::WelcomeHelper do
end
with_them do
context 'regardless of if the onboarding issues experiment is enabled' do
where(onboarding_issues_experiment_enabled: [true, false])
context 'regardless of signup onboarding' do
where(signup_onboarding_enabled: [true, false])
with_them do
it { is_expected.to eq('Continue') }
......@@ -203,8 +203,8 @@ RSpec.describe EE::WelcomeHelper do
end
with_them do
context 'regardless of if the onboarding issues experiment is enabled' do
where(onboarding_issues_experiment_enabled: [true, false])
context 'regardless of signup onboarding' do
where(signup_onboarding_enabled: [true, false])
with_them do
it { is_expected.to eq('Get started!') }
......@@ -214,13 +214,13 @@ RSpec.describe EE::WelcomeHelper do
end
context 'and not in the invitation or oauth flow' do
where(:onboarding_issues_experiment_enabled, :result) do
where(:signup_onboarding_enabled, :result) do
true | 'Continue'
false | 'Get started!'
end
with_them do
it 'depends on whether or not the onboarding issues experiment is enabled' do
it 'depends on whether or not signup onboarding is enabled' do
is_expected.to eq(result)
end
end
......@@ -231,7 +231,7 @@ RSpec.describe EE::WelcomeHelper do
describe '#data_attributes_for_progress_bar_js_component' do
before do
allow(helper).to receive(:in_subscription_flow?).and_return(options_enabled)
allow(helper).to receive(:onboarding_issues_experiment_enabled?).and_return(options_enabled)
allow(helper).to receive(:signup_onboarding_enabled?).and_return(options_enabled)
end
subject { helper.tag(:div, data: helper.data_attributes_for_progress_bar_js_component) }
......@@ -243,7 +243,7 @@ RSpec.describe EE::WelcomeHelper do
with_them do
it 'always includes both attributes with stringified boolean values' do
is_expected.to eq(%{<div data-is-in-subscription-flow="#{attr_values}" data-is-onboarding-issues-experiment-enabled="#{attr_values}" />})
is_expected.to eq(%{<div data-is-in-subscription-flow="#{attr_values}" data-is-signup-onboarding-enabled="#{attr_values}" />})
end
end
end
......@@ -282,4 +282,24 @@ RSpec.describe EE::WelcomeHelper do
is_expected.to eq(false)
end
end
describe '#signup_onboarding_enabled?' do
subject { helper.signup_onboarding_enabled? }
where(:is_com, :feature_flag_enabled, :result) do
true | true | true
true | false | false
false | true | false
false | false | false
end
with_them do
before do
expect(Gitlab).to receive(:com?).and_return(is_com)
stub_feature_flags(signup_onboarding: feature_flag_enabled)
end
it { is_expected.to eq(result) }
end
end
end
......@@ -11,7 +11,7 @@ RSpec.describe 'registrations/welcome/show' do
before do
allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:redirect_path).and_return(redirect_path)
allow(view).to receive(:onboarding_issues_experiment_enabled?).and_return(onboarding_issues_experiment_enabled)
allow(view).to receive(:signup_onboarding_enabled?).and_return(signup_onboarding_enabled)
allow(Gitlab).to receive(:com?).and_return(true)
stub_feature_flags(user_other_role_details: user_other_role_details_enabled)
......@@ -20,7 +20,7 @@ RSpec.describe 'registrations/welcome/show' do
subject { rendered }
where(:redirect_path, :onboarding_issues_experiment_enabled, :show_progress_bar, :flow, :is_continue) do
where(:redirect_path, :signup_onboarding_enabled, :show_progress_bar, :flow, :is_continue) do
'/-/subscriptions/new' | false | true | :subscription | true
'/-/subscriptions/new' | true | true | :subscription | true
'/-/trials/new' | false | false | :trial | true
......
......@@ -34,10 +34,6 @@
module Gitlab
module Experimentation
EXPERIMENTS = {
onboarding_issues: {
tracking_category: 'Growth::Conversion::Experiment::OnboardingIssues',
use_backwards_compatible_subject_index: true
},
ci_notification_dot: {
tracking_category: 'Growth::Expansion::Experiment::CiNotificationDot',
use_backwards_compatible_subject_index: true
......
......@@ -21,20 +21,11 @@ RSpec.describe Registrations::ExperienceLevelsController do
context 'with an authenticated user' do
before do
sign_in(user)
stub_experiment_for_subject(onboarding_issues: true)
end
it { is_expected.to have_gitlab_http_status(:ok) }
it { is_expected.to render_template('layouts/devise_experimental_onboarding_issues') }
it { is_expected.to render_template('layouts/signup_onboarding') }
it { is_expected.to render_template(:show) }
context 'when not part of the onboarding issues experiment' do
before do
stub_experiment_for_subject(onboarding_issues: false)
end
it { is_expected.to have_gitlab_http_status(:not_found) }
end
end
end
......@@ -52,15 +43,6 @@ RSpec.describe Registrations::ExperienceLevelsController do
before do
sign_in(user)
stub_experiment_for_subject(onboarding_issues: true)
end
context 'when not part of the onboarding issues experiment' do
before do
stub_experiment_for_subject(onboarding_issues: false)
end
it { is_expected.to have_gitlab_http_status(:not_found) }
end
context 'when user is successfully updated' do
......
......@@ -9,7 +9,6 @@ RSpec.describe 'Experience level screen' do
before do
group.add_owner(user)
gitlab_sign_in(user)
stub_experiment_for_subject(onboarding_issues: true)
visit users_sign_up_experience_level_path(namespace_path: group.to_param)
end
......
......@@ -7,7 +7,6 @@ require 'spec_helper'
RSpec.describe Gitlab::Experimentation::EXPERIMENTS do
it 'temporarily ensures we know what experiments exist for backwards compatibility' do
expected_experiment_keys = [
:onboarding_issues,
:ci_notification_dot,
:upgrade_link_in_user_menu_a,
:invite_members_version_a,
......
......@@ -13,7 +13,6 @@ RSpec.describe 'registrations/welcome/show' do
allow(view).to receive(:in_trial_flow?).and_return(false)
allow(view).to receive(:in_invitation_flow?).and_return(false)
allow(view).to receive(:in_oauth_flow?).and_return(false)
allow(view).to receive(:experiment_enabled?).with(:onboarding_issues).and_return(false)
allow(Gitlab).to receive(:com?).and_return(false)
render
......
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