diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 21:07:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 21:07:31 +0300 |
commit | d91f5211693e913da5df110b8de841fad87e3653 (patch) | |
tree | d1483aeb8fe3d2b9579b0e44f2e74979c4b8d17a /spec/lib/gitlab/experimentation_spec.rb | |
parent | c859c3bfd242288065fe5e2d887f7204f09e2335 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/experimentation_spec.rb')
-rw-r--r-- | spec/lib/gitlab/experimentation_spec.rb | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/spec/lib/gitlab/experimentation_spec.rb b/spec/lib/gitlab/experimentation_spec.rb index e4624accd58..1506794cbb5 100644 --- a/spec/lib/gitlab/experimentation_spec.rb +++ b/spec/lib/gitlab/experimentation_spec.rb @@ -96,10 +96,10 @@ describe Gitlab::Experimentation do expect(Gitlab::Tracking).to receive(:event).with( 'Team', 'start', - label: nil, - property: 'experimental_group' + property: 'experimental_group', + value: 'team_id' ) - controller.track_experiment_event(:test_experiment, 'start') + controller.track_experiment_event(:test_experiment, 'start', 'team_id') end end @@ -112,10 +112,10 @@ describe Gitlab::Experimentation do expect(Gitlab::Tracking).to receive(:event).with( 'Team', 'start', - label: nil, - property: 'control_group' + property: 'control_group', + value: 'team_id' ) - controller.track_experiment_event(:test_experiment, 'start') + controller.track_experiment_event(:test_experiment, 'start', 'team_id') end end end @@ -144,13 +144,13 @@ describe Gitlab::Experimentation do end it 'pushes the right parameters to gon' do - controller.frontend_experimentation_tracking_data(:test_experiment, 'start') + controller.frontend_experimentation_tracking_data(:test_experiment, 'start', 'team_id') expect(Gon.tracking_data).to eq( { category: 'Team', action: 'start', - label: nil, - property: 'experimental_group' + property: 'experimental_group', + value: 'team_id' } ) end @@ -164,12 +164,23 @@ describe Gitlab::Experimentation do end it 'pushes the right parameters to gon' do + controller.frontend_experimentation_tracking_data(:test_experiment, 'start', 'team_id') + expect(Gon.tracking_data).to eq( + { + category: 'Team', + action: 'start', + property: 'control_group', + value: 'team_id' + } + ) + end + + it 'does not send nil value to gon' do controller.frontend_experimentation_tracking_data(:test_experiment, 'start') expect(Gon.tracking_data).to eq( { category: 'Team', action: 'start', - label: nil, property: 'control_group' } ) |