Commit edf6c4ae authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch...

Merge branch '326256-experiment-cleanup-add-an-invite-team-members-cta-to-the-project-empty-state' into 'master'

Experiment cleanup  "Invite team members" CTA on the project empty state [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!62417
parents ec7e5b68 20ded4ce
......@@ -330,11 +330,7 @@ class ProjectsController < Projects::ApplicationController
experiment(:empty_repo_upload, project: @project).track(:view_project_show, property: property)
end
if @project.empty_repo?
record_experiment_user(:invite_members_empty_project_version_a)
render 'projects/empty'
end
render 'projects/empty' if @project.empty_repo?
else
if can?(current_user, :read_wiki, @project)
@wiki = @project.wiki
......
......@@ -7,7 +7,7 @@
= render "home_panel"
= render "archived_notice", project: @project
= render "invite_members" if experiment_enabled?(:invite_members_empty_project_version_a) && can_import_members?
= render "invite_members" if can_import_members?
%h4.gl-mt-0.gl-mb-3
= _('The repository for this project is empty')
......
---
name: invite_members_empty_project_version_a_experiment_percentage
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49588
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/262014
milestone: '13.7'
type: experiment
group: group::expansion
default_enabled: false
......@@ -45,9 +45,6 @@ module Gitlab
remove_known_trial_form_fields: {
tracking_category: 'Growth::Conversion::Experiment::RemoveKnownTrialFormFields'
},
invite_members_empty_project_version_a: {
tracking_category: 'Growth::Expansion::Experiment::InviteMembersEmptyProjectVersionA'
},
invite_members_new_dropdown: {
tracking_category: 'Growth::Expansion::Experiment::InviteMembersNewDropdown'
},
......
......@@ -243,9 +243,8 @@ RSpec.describe ProjectsController do
get :show, params: { namespace_id: empty_project.namespace, id: empty_project }
end
it "renders the empty project view and records the experiment user", :aggregate_failures do
it "renders the empty project view" do
expect(response).to render_template('empty')
expect(controller).to have_received(:record_experiment_user).with(:invite_members_empty_project_version_a)
end
end
end
......
......@@ -46,47 +46,32 @@ RSpec.describe 'projects/empty' do
end
end
describe 'invite_members_empty_project_version_a experiment' do
context 'with invite button on empty projects' do
let(:can_import_members) { true }
before do
allow(view).to receive(:can_import_members?).and_return(can_import_members)
end
shared_examples_for 'no invite member info' do
it 'does not show invite member info' do
render
it 'shows invite members info', :aggregate_failures do
render
expect(rendered).not_to have_content('Invite your team')
end
expect(rendered).to have_selector('[data-track-event=render]')
expect(rendered).to have_selector('[data-track-label=invite_members_empty_project]', count: 2)
expect(rendered).to have_content('Invite your team')
expect(rendered).to have_content('Add members to this project and start collaborating with your team.')
expect(rendered).to have_link('Invite members', href: project_project_members_path(project, sort: :access_level_desc))
expect(rendered).to have_selector('[data-track-event=click_button]')
end
context 'when experiment is enabled' do
it 'shows invite members info', :aggregate_failures do
render
expect(rendered).to have_selector('[data-track-event=render]')
expect(rendered).to have_selector('[data-track-label=invite_members_empty_project]', count: 2)
expect(rendered).to have_content('Invite your team')
expect(rendered).to have_content('Add members to this project and start collaborating with your team.')
expect(rendered).to have_link('Invite members', href: project_project_members_path(project, sort: :access_level_desc))
expect(rendered).to have_selector('[data-track-event=click_button]')
end
context 'when user does not have permissions to invite members' do
let(:can_import_members) { false }
context 'when user does not have permissions to invite members' do
let(:can_import_members) { false }
it_behaves_like 'no invite member info'
end
end
it 'does not show invite member info' do
render
context 'when experiment is not enabled' do
before do
allow(view).to receive(:experiment_enabled?)
.with(:invite_members_empty_project_version_a).and_return(false)
expect(rendered).not_to have_content('Invite your team')
end
it_behaves_like 'no invite member info'
end
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