Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-01-27 12:14:40 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-01-27 12:14:40 +0300
commit43511919ac44a093aa93df46fba8f308ae8ddaac (patch)
tree158247fc04a842df963cde07d51058a8283a17ad /spec/experiments
parent62b1efcc13b511943d1e0b96f13ce435571997ac (diff)
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.rb18
1 files changed, 17 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..5d9b0770fb5 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,7 @@ require 'spec_helper'
RSpec.describe RequireVerificationForNamespaceCreationExperiment, :experiment do
subject(:experiment) { described_class.new(user: user) }
- let_it_be(:user) { create(:user) }
+ let(:user) { create(:user, created_at: RequireVerificationForNamespaceCreationExperiment::EXPERIMENT_START_DATE + 1.hour) }
describe '#candidate?' do
context 'when experiment subject is candidate' do
@@ -56,4 +56,20 @@ 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) { create(:user, created_at: RequireVerificationForNamespaceCreationExperiment::EXPERIMENT_START_DATE - 1.day) }
+
+ it 'is excluded' do
+ expect(subject).to exclude(user: user)
+ end
+ end
+ end
end