Commit 825beeff authored by Kerri Miller's avatar Kerri Miller

Merge branch 'jj-track-checkbox-on-new-project-readme-experiment' into 'master'

Add checkbox to value of tracking call

See merge request gitlab-org/gitlab!54013
parents 5cb119b1 9e5e11c8
......@@ -74,7 +74,11 @@ class ProjectsController < Projects::ApplicationController
@project = ::Projects::CreateService.new(current_user, project_params(attributes: project_params_create_attributes)).execute
if @project.saved?
experiment(:new_project_readme, actor: current_user).track(:created, property: active_new_project_tab)
experiment(:new_project_readme, actor: current_user).track(
:created,
property: active_new_project_tab,
value: project_params[:initialize_with_readme].to_i
)
redirect_to(
project_path(@project, custom_import_params),
notice: _("Project '%{project_name}' was successfully created.") % { project_name: @project.name }
......
......@@ -430,7 +430,8 @@ RSpec.describe ProjectsController do
path: 'foo',
description: 'bar',
namespace_id: user.namespace.id,
visibility_level: Gitlab::VisibilityLevel::PUBLIC
visibility_level: Gitlab::VisibilityLevel::PUBLIC,
initialize_with_readme: 1
}
end
......@@ -439,9 +440,11 @@ RSpec.describe ProjectsController do
end
it 'tracks a created event for the new_project_readme experiment', :experiment do
expect(experiment(:new_project_readme)).to track(:created, property: 'blank').on_any_instance.with_context(
actor: user
)
expect(experiment(:new_project_readme)).to track(
:created,
property: 'blank',
value: 1
).on_any_instance.with_context(actor: user)
post :create, params: { project: project_params }
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