Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c9fece74
Commit
c9fece74
authored
Dec 04, 2020
by
Alper Akgun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a context for experiment recording
for "Remove known fields from trial sign up form" growth experiment
parent
90f18823
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
ee/app/controllers/trials_controller.rb
ee/app/controllers/trials_controller.rb
+9
-1
ee/spec/controllers/trials_controller_spec.rb
ee/spec/controllers/trials_controller_spec.rb
+2
-2
No files found.
ee/app/controllers/trials_controller.rb
View file @
c9fece74
...
...
@@ -13,7 +13,7 @@ class TrialsController < ApplicationController
feature_category
:purchase
def
new
record_experiment_user
(
:remove_known_trial_form_fields
)
record_experiment_user
(
:remove_known_trial_form_fields
,
remove_known_trial_form_fields_context
)
record_experiment_user
(
:trimmed_skip_trial_copy
)
end
...
...
@@ -115,4 +115,12 @@ class TrialsController < ApplicationController
def
record_user_for_group_only_trials_experiment
record_experiment_user
(
:group_only_trials
)
end
def
remove_known_trial_form_fields_context
{
first_name_present:
current_user
.
first_name
.
present?
,
last_name_present:
current_user
.
last_name
.
present?
,
company_name_present:
current_user
.
organization
.
present?
}
end
end
ee/spec/controllers/trials_controller_spec.rb
View file @
c9fece74
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
TrialsController
do
let_it_be
(
:user
)
{
create
(
:user
,
email_opted_in:
true
,
last_name:
'Doe'
)
}
let_it_be
(
:
experiment_user
_context
)
do
let_it_be
(
:
remove_known_trial_form_fields
_context
)
do
{
first_name_present:
user
.
first_name
.
present?
,
last_name_present:
user
.
last_name
.
present?
,
...
...
@@ -55,7 +55,7 @@ RSpec.describe TrialsController do
end
it
'calls record_experiment_user for the remove_known_trial_form_fields & trimmed_skip_trial_copy experiments'
do
expect
(
controller
).
to
receive
(
:record_experiment_user
).
with
(
:remove_known_trial_form_fields
)
expect
(
controller
).
to
receive
(
:record_experiment_user
).
with
(
:remove_known_trial_form_fields
,
remove_known_trial_form_fields_context
)
expect
(
controller
).
to
receive
(
:record_experiment_user
).
with
(
:trimmed_skip_trial_copy
)
subject
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment