Commit e94e5878 authored by Sean McGivern's avatar Sean McGivern

Merge branch '337965-remove-experiment-word-for-continuous-onboarding' into 'master'

Remove experiment word from continuous onboarding

See merge request gitlab-org/gitlab!69991
parents 52b02359 93529874
...@@ -12,6 +12,6 @@ class Projects::LearnGitlabController < Projects::ApplicationController ...@@ -12,6 +12,6 @@ class Projects::LearnGitlabController < Projects::ApplicationController
private private
def check_experiment_enabled? def check_experiment_enabled?
return access_denied! unless helpers.learn_gitlab_experiment_enabled?(project) return access_denied! unless helpers.learn_gitlab_enabled?(project)
end end
end end
# frozen_string_literal: true # frozen_string_literal: true
module LearnGitlabHelper module LearnGitlabHelper
def learn_gitlab_experiment_enabled?(project) def learn_gitlab_enabled?(project)
return false unless current_user return false unless current_user
learn_gitlab_onboarding_available?(project) learn_gitlab_onboarding_available?(project)
......
...@@ -87,7 +87,7 @@ module SidebarsHelper ...@@ -87,7 +87,7 @@ module SidebarsHelper
{ {
current_user: user, current_user: user,
container: project, container: project,
learn_gitlab_experiment_enabled: learn_gitlab_experiment_enabled?(project), learn_gitlab_enabled: learn_gitlab_enabled?(project),
current_ref: current_ref, current_ref: current_ref,
jira_issues_integration: project_jira_issues_integration?, jira_issues_integration: project_jira_issues_integration?,
can_view_pipeline_editor: can_view_pipeline_editor?(project), can_view_pipeline_editor: can_view_pipeline_editor?(project),
......
...@@ -23,7 +23,7 @@ module Sidebars ...@@ -23,7 +23,7 @@ module Sidebars
override :has_pill? override :has_pill?
def has_pill? def has_pill?
context.learn_gitlab_experiment_enabled context.learn_gitlab_enabled
end end
override :pill_count override :pill_count
...@@ -52,7 +52,7 @@ module Sidebars ...@@ -52,7 +52,7 @@ module Sidebars
override :render? override :render?
def render? def render?
context.learn_gitlab_experiment_enabled context.learn_gitlab_enabled
end end
end end
end end
......
...@@ -7,13 +7,13 @@ RSpec.describe Projects::LearnGitlabController do ...@@ -7,13 +7,13 @@ RSpec.describe Projects::LearnGitlabController do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, namespace: user.namespace) } let_it_be(:project) { create(:project, namespace: user.namespace) }
let(:learn_gitlab_experiment_enabled) { true } let(:learn_gitlab_enabled) { true }
let(:params) { { namespace_id: project.namespace.to_param, project_id: project } } let(:params) { { namespace_id: project.namespace.to_param, project_id: project } }
subject { get :index, params: params } subject { get :index, params: params }
before do before do
allow(controller.helpers).to receive(:learn_gitlab_experiment_enabled?).and_return(learn_gitlab_experiment_enabled) allow(controller.helpers).to receive(:learn_gitlab_enabled?).and_return(learn_gitlab_enabled)
end end
context 'unauthenticated user' do context 'unauthenticated user' do
...@@ -28,7 +28,7 @@ RSpec.describe Projects::LearnGitlabController do ...@@ -28,7 +28,7 @@ RSpec.describe Projects::LearnGitlabController do
it { is_expected.to render_template(:index) } it { is_expected.to render_template(:index) }
context 'learn_gitlab experiment not enabled' do context 'learn_gitlab experiment not enabled' do
let(:learn_gitlab_experiment_enabled) { false } let(:learn_gitlab_enabled) { false }
it { is_expected.to have_gitlab_http_status(:not_found) } it { is_expected.to have_gitlab_http_status(:not_found) }
end end
......
...@@ -53,7 +53,7 @@ RSpec.describe LearnGitlabHelper do ...@@ -53,7 +53,7 @@ RSpec.describe LearnGitlabHelper do
end end
end end
describe '.learn_gitlab_experiment_enabled?' do describe '.learn_gitlab_enabled?' do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
...@@ -61,7 +61,7 @@ RSpec.describe LearnGitlabHelper do ...@@ -61,7 +61,7 @@ RSpec.describe LearnGitlabHelper do
let(:params) { { namespace_id: project.namespace.to_param, project_id: project } } let(:params) { { namespace_id: project.namespace.to_param, project_id: project } }
subject { helper.learn_gitlab_experiment_enabled?(project) } subject { helper.learn_gitlab_enabled?(project) }
where(:onboarding, :learn_gitlab_available, :result) do where(:onboarding, :learn_gitlab_available, :result) do
true | true | true true | true | true
......
...@@ -4,13 +4,13 @@ require 'spec_helper' ...@@ -4,13 +4,13 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::LearnGitlabMenu do RSpec.describe Sidebars::Projects::Menus::LearnGitlabMenu do
let_it_be(:project) { build(:project) } let_it_be(:project) { build(:project) }
let_it_be(:experiment_enabled) { true } let_it_be(:learn_gitlab_enabled) { true }
let(:context) do let(:context) do
Sidebars::Projects::Context.new( Sidebars::Projects::Context.new(
current_user: nil, current_user: nil,
container: project, container: project,
learn_gitlab_experiment_enabled: experiment_enabled learn_gitlab_enabled: learn_gitlab_enabled
) )
end end
...@@ -43,7 +43,7 @@ RSpec.describe Sidebars::Projects::Menus::LearnGitlabMenu do ...@@ -43,7 +43,7 @@ RSpec.describe Sidebars::Projects::Menus::LearnGitlabMenu do
end end
context 'when learn gitlab experiment is disabled' do context 'when learn gitlab experiment is disabled' do
let(:experiment_enabled) { false } let(:learn_gitlab_enabled) { false }
it 'returns false' do it 'returns false' do
expect(subject.render?).to eq false expect(subject.render?).to eq false
...@@ -59,7 +59,7 @@ RSpec.describe Sidebars::Projects::Menus::LearnGitlabMenu do ...@@ -59,7 +59,7 @@ RSpec.describe Sidebars::Projects::Menus::LearnGitlabMenu do
end end
context 'when learn gitlab experiment is disabled' do context 'when learn gitlab experiment is disabled' do
let(:experiment_enabled) { false } let(:learn_gitlab_enabled) { false }
it 'returns false' do it 'returns false' do
expect(subject.has_pill?).to eq false expect(subject.has_pill?).to eq false
......
...@@ -68,8 +68,8 @@ RSpec.describe 'layouts/nav/sidebar/_project' do ...@@ -68,8 +68,8 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
end end
describe 'Learn GitLab' do describe 'Learn GitLab' do
it 'has a link to the learn GitLab experiment' do it 'has a link to the learn GitLab' do
allow(view).to receive(:learn_gitlab_experiment_enabled?).and_return(true) allow(view).to receive(:learn_gitlab_enabled?).and_return(true)
allow_next_instance_of(LearnGitlab::Onboarding) do |onboarding| allow_next_instance_of(LearnGitlab::Onboarding) do |onboarding|
expect(onboarding).to receive(:completed_percentage).and_return(20) expect(onboarding).to receive(:completed_percentage).and_return(20)
end 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