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
c1e037c5
Commit
c1e037c5
authored
Oct 22, 2020
by
Dallas Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adhere to our testing best-practices
parent
784e8e0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
spec/lib/gitlab/experimentation_spec.rb
spec/lib/gitlab/experimentation_spec.rb
+7
-3
No files found.
spec/lib/gitlab/experimentation_spec.rb
View file @
c1e037c5
...
...
@@ -90,12 +90,16 @@ RSpec.describe Gitlab::Experimentation, :snowplow do
end
describe
'#experiment_enabled?'
do
subject
{
controller
.
experiment_enabled?
(
:test_experiment
)
}
def
check_experiment
(
exp_key
=
:test_experiment
)
controller
.
experiment_enabled?
(
exp_key
)
end
subject
{
check_experiment
}
context
'cookie is not present'
do
it
'calls Gitlab::Experimentation.enabled_for_value? with the name of the experiment and an experimentation_subject_index of nil'
do
expect
(
Gitlab
::
Experimentation
).
to
receive
(
:enabled_for_value?
).
with
(
:test_experiment
,
nil
)
subjec
t
check_experimen
t
end
end
...
...
@@ -115,7 +119,7 @@ RSpec.describe Gitlab::Experimentation, :snowplow do
with_them
do
it
'calls Gitlab::Experimentation.enabled_for_value? with the name of the experiment and the calculated experimentation_subject_index based on the uuid'
do
expect
(
Gitlab
::
Experimentation
).
to
receive
(
:enabled_for_value?
).
with
(
experiment_key
,
index_value
)
c
ontroller
.
experiment_enabled?
(
experiment_key
)
c
heck_experiment
(
experiment_key
)
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