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
62cb58cc
Commit
62cb58cc
authored
Jun 14, 2021
by
Dallas Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Record the ExperimentSubject for the Highlight Paid Features experiment
parent
885ebcee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
ee/app/helpers/paid_feature_callout_helper.rb
ee/app/helpers/paid_feature_callout_helper.rb
+1
-0
ee/spec/helpers/paid_feature_callout_helper_spec.rb
ee/spec/helpers/paid_feature_callout_helper_spec.rb
+21
-3
No files found.
ee/app/helpers/paid_feature_callout_helper.rb
View file @
62cb58cc
...
@@ -10,6 +10,7 @@ module PaidFeatureCalloutHelper
...
@@ -10,6 +10,7 @@ module PaidFeatureCalloutHelper
e
.
exclude!
unless
group
&&
eligible_for_trial_upgrade_callout?
(
group
)
e
.
exclude!
unless
group
&&
eligible_for_trial_upgrade_callout?
(
group
)
e
.
use
{
nil
}
# control gets nothing new added to the existing UI
e
.
use
{
nil
}
# control gets nothing new added to the existing UI
e
.
try
(
&
block
)
e
.
try
(
&
block
)
e
.
record!
end
end
end
end
...
...
ee/spec/helpers/paid_feature_callout_helper_spec.rb
View file @
62cb58cc
...
@@ -22,20 +22,35 @@ RSpec.describe PaidFeatureCalloutHelper do
...
@@ -22,20 +22,35 @@ RSpec.describe PaidFeatureCalloutHelper do
subject
{
helper
.
run_highlight_paid_features_during_active_trial_experiment
(
group
,
&
candidate_block
).
run
}
subject
{
helper
.
run_highlight_paid_features_during_active_trial_experiment
(
group
,
&
candidate_block
).
run
}
context
'when the user is in the candidate'
do
shared_examples
'records an ExperimentSubject'
do
let
(
:variant
)
{
:candidate
}
it
'records the group as an ExperimentSubject'
do
expect
{
subject
}.
to
change
{
ExperimentSubject
.
count
}
end
end
it
{
is_expected
.
to
eq
(
'in candidate'
)
}
shared_examples
'does not record an ExperimentSubject'
do
it
'does not record the group as an ExperimentSubject'
do
expect
{
subject
}.
not_to
change
{
ExperimentSubject
.
count
}
end
end
end
shared_examples
'user receives control experience'
do
shared_examples
'user receives control experience'
do
it
{
is_expected
.
to
be_nil
}
it
{
is_expected
.
to
be_nil
}
end
end
context
'when the user is in the candidate'
do
let
(
:variant
)
{
:candidate
}
it
{
is_expected
.
to
eq
(
'in candidate'
)
}
include_examples
'records an ExperimentSubject'
end
context
'when the user is in the control'
do
context
'when the user is in the control'
do
let
(
:variant
)
{
:control
}
let
(
:variant
)
{
:control
}
include_examples
'user receives control experience'
include_examples
'user receives control experience'
include_examples
'records an ExperimentSubject'
end
end
context
'when the user would be in the candidate'
do
context
'when the user would be in the candidate'
do
...
@@ -45,18 +60,21 @@ RSpec.describe PaidFeatureCalloutHelper do
...
@@ -45,18 +60,21 @@ RSpec.describe PaidFeatureCalloutHelper do
let
(
:trials_available
)
{
false
}
let
(
:trials_available
)
{
false
}
include_examples
'user receives control experience'
include_examples
'user receives control experience'
include_examples
'does not record an ExperimentSubject'
end
end
context
'but the group is not in an active trial'
do
context
'but the group is not in an active trial'
do
let
(
:group_has_active_trial
)
{
false
}
let
(
:group_has_active_trial
)
{
false
}
include_examples
'user receives control experience'
include_examples
'user receives control experience'
include_examples
'does not record an ExperimentSubject'
end
end
context
'but the user is not an admin of the group'
do
context
'but the user is not an admin of the group'
do
let
(
:user_can_admin_group
)
{
false
}
let
(
:user_can_admin_group
)
{
false
}
include_examples
'user receives control experience'
include_examples
'user receives control experience'
include_examples
'does not record an ExperimentSubject'
end
end
end
end
end
end
...
...
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