Commit 1631bc18 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '246795-experiment-new-user-onboarding-default-to-viewing-issue-board' into 'master'

Experiment: New user onboarding default to viewing issue board

See merge request gitlab-org/gitlab!43939
parents 37e05ab8 cb3a898f
...@@ -14,7 +14,13 @@ module Registrations ...@@ -14,7 +14,13 @@ module Registrations
if current_user.save if current_user.save
hide_advanced_issues hide_advanced_issues
redirect_to group_path(params[:namespace_path]) record_experiment_user(:default_to_issues_board)
if experiment_enabled?(:default_to_issues_board) && learn_gitlab.available?
redirect_to namespace_project_board_path(params[:namespace_path], learn_gitlab.project, learn_gitlab.board)
else
redirect_to group_path(params[:namespace_path])
end
else else
render :show render :show
end end
......
...@@ -68,6 +68,9 @@ module Gitlab ...@@ -68,6 +68,9 @@ module Gitlab
}, },
group_only_trials: { group_only_trials: {
tracking_category: 'Growth::Conversion::Experiment::GroupOnlyTrials' tracking_category: 'Growth::Conversion::Experiment::GroupOnlyTrials'
},
default_to_issues_board: {
tracking_category: 'Growth::Conversion::Experiment::DefaultToIssuesBoard'
} }
}.freeze }.freeze
......
...@@ -85,16 +85,49 @@ RSpec.describe Registrations::ExperienceLevelsController do ...@@ -85,16 +85,49 @@ RSpec.describe Registrations::ExperienceLevelsController do
end end
end end
context 'when a namespace_path is sent' do describe 'redirection' do
it { is_expected.to have_gitlab_http_status(:redirect) } let(:project) { build(:project, namespace: namespace, creator: user, path: 'project-path') }
it { is_expected.to redirect_to(group_path(namespace)) } let(:issues_board) { build(:board, id: 123, project: project) }
end
before do
stub_experiment_for_user(
onboarding_issues: true,
default_to_issues_board: default_to_issues_board_xp?
)
allow_next_instance_of(LearnGitlab) do |learn_gitlab|
allow(learn_gitlab).to receive(:available?).and_return(learn_gitlab_available?)
allow(learn_gitlab).to receive(:project).and_return(project)
allow(learn_gitlab).to receive(:board).and_return(issues_board)
end
end
context 'when namespace_path param is missing' do
let(:params) { super().merge(namespace_path: nil) }
where(
default_to_issues_board_xp?: [true, false],
learn_gitlab_available?: [true, false]
)
context 'when no namespace_path is sent' do with_them do
let(:params) { super().merge(namespace_path: nil) } it { is_expected.to redirect_to('/') }
end
end
it { is_expected.to have_gitlab_http_status(:redirect) } context 'when we have a namespace_path param' do
it { is_expected.to redirect_to(root_path) } using RSpec::Parameterized::TableSyntax
where(:default_to_issues_board_xp?, :learn_gitlab_available?, :path) do
true | true | '/group-path/project-path/-/boards/123'
true | false | '/group-path'
false | true | '/group-path'
false | false | '/group-path'
end
with_them do
it { is_expected.to redirect_to(path) }
end
end
end end
describe 'applying the chosen level' do describe 'applying the chosen level' do
......
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