diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /spec/lib/gitlab/experimentation | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/lib/gitlab/experimentation')
-rw-r--r-- | spec/lib/gitlab/experimentation/controller_concern_spec.rb | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/spec/lib/gitlab/experimentation/controller_concern_spec.rb b/spec/lib/gitlab/experimentation/controller_concern_spec.rb index 5419a01ea3e..7a619c9f155 100644 --- a/spec/lib/gitlab/experimentation/controller_concern_spec.rb +++ b/spec/lib/gitlab/experimentation/controller_concern_spec.rb @@ -196,9 +196,12 @@ RSpec.describe Gitlab::Experimentation::ControllerConcern, type: :controller do end describe '#track_experiment_event', :snowplow do + let(:user) { build(:user) } + context 'when the experiment is enabled' do before do stub_experiment(test_experiment: true) + allow(controller).to receive(:current_user).and_return(user) end context 'the user is part of the experimental group' do @@ -213,7 +216,8 @@ RSpec.describe Gitlab::Experimentation::ControllerConcern, type: :controller do category: 'Team', action: 'start', property: 'experimental_group', - value: 1 + value: 1, + user: user ) end end @@ -230,7 +234,8 @@ RSpec.describe Gitlab::Experimentation::ControllerConcern, type: :controller do category: 'Team', action: 'start', property: 'control_group', - value: 1 + value: 1, + user: user ) end end @@ -247,7 +252,8 @@ RSpec.describe Gitlab::Experimentation::ControllerConcern, type: :controller do category: 'Team', action: 'start', property: 'control_group', - value: 1 + value: 1, + user: user ) end end @@ -280,7 +286,8 @@ RSpec.describe Gitlab::Experimentation::ControllerConcern, type: :controller do action: 'start', property: 'control_group', value: 1, - label: Digest::MD5.hexdigest('abc') + label: Digest::MD5.hexdigest('abc'), + user: user ) end @@ -294,7 +301,8 @@ RSpec.describe Gitlab::Experimentation::ControllerConcern, type: :controller do action: 'start', property: 'control_group', value: 1, - label: Digest::MD5.hexdigest('somestring') + label: Digest::MD5.hexdigest('somestring'), + user: user ) end end @@ -313,7 +321,8 @@ RSpec.describe Gitlab::Experimentation::ControllerConcern, type: :controller do action: 'start', property: 'control_group', value: 1, - label: cookies.permanent.signed[:experimentation_subject_id] + label: cookies.permanent.signed[:experimentation_subject_id], + user: user ) end end |