diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-31 12:17:41 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-31 12:17:41 +0000 |
commit | 8bdb37de3a85f3e6b02963bcc938a3a830109e45 (patch) | |
tree | bfd5447a1adab314a6f9ce99155ef285a2de4935 /spec/experiments | |
parent | 1edfc04d9f768d6cfa9256eaa54f382112be7497 (diff) | |
download | gitlab-ce-8bdb37de3a85f3e6b02963bcc938a3a830109e45.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/experiments')
-rw-r--r-- | spec/experiments/require_verification_for_namespace_creation_experiment_spec.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/experiments/require_verification_for_namespace_creation_experiment_spec.rb b/spec/experiments/require_verification_for_namespace_creation_experiment_spec.rb index 87417fe1637..269b6222020 100644 --- a/spec/experiments/require_verification_for_namespace_creation_experiment_spec.rb +++ b/spec/experiments/require_verification_for_namespace_creation_experiment_spec.rb @@ -5,7 +5,8 @@ require 'spec_helper' RSpec.describe RequireVerificationForNamespaceCreationExperiment, :experiment do subject(:experiment) { described_class.new(user: user) } - let_it_be(:user) { create(:user) } + let(:user_created_at) { RequireVerificationForNamespaceCreationExperiment::EXPERIMENT_START_DATE + 1.hour } + let(:user) { create(:user, created_at: user_created_at) } describe '#candidate?' do context 'when experiment subject is candidate' do @@ -56,4 +57,21 @@ RSpec.describe RequireVerificationForNamespaceCreationExperiment, :experiment do end end end + + describe 'exclusions' do + context 'when user is new' do + it 'is not excluded' do + expect(subject).not_to exclude(user: user) + end + end + + context 'when user is NOT new' do + let(:user_created_at) { RequireVerificationForNamespaceCreationExperiment::EXPERIMENT_START_DATE - 1.day } + let(:user) { create(:user, created_at: user_created_at) } + + it 'is excluded' do + expect(subject).to exclude(user: user) + end + end + end end |