summaryrefslogtreecommitdiff
path: root/spec/support_specs
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 18:42:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 18:42:06 +0000
commit6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch)
tree78be5963ec075d80116a932011d695dd33910b4e /spec/support_specs
parent1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff)
downloadgitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/support_specs')
-rw-r--r--spec/support_specs/helpers/stub_feature_flags_spec.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/support_specs/helpers/stub_feature_flags_spec.rb b/spec/support_specs/helpers/stub_feature_flags_spec.rb
index 8d5f16751ae..5d1e4e1627d 100644
--- a/spec/support_specs/helpers/stub_feature_flags_spec.rb
+++ b/spec/support_specs/helpers/stub_feature_flags_spec.rb
@@ -119,6 +119,42 @@ RSpec.describe StubFeatureFlags do
end
end
+ describe 'stub timing' do
+ context 'let_it_be variable' do
+ let_it_be(:let_it_be_var) { Feature.enabled?(:any_feature_flag) }
+
+ it { expect(let_it_be_var).to eq true }
+ end
+
+ context 'before_all variable' do
+ before_all do
+ @suite_var = Feature.enabled?(:any_feature_flag)
+ end
+
+ it { expect(@suite_var).to eq true }
+ end
+
+ context 'before(:all) variable' do
+ before(:all) do
+ @suite_var = Feature.enabled?(:any_feature_flag)
+ end
+
+ it { expect(@suite_var).to eq true }
+ end
+
+ context 'with stub_feature_flags meta' do
+ let(:var) { Feature.enabled?(:any_feature_flag) }
+
+ context 'as true', :stub_feature_flags do
+ it { expect(var).to eq true }
+ end
+
+ context 'as false', stub_feature_flags: false do
+ it { expect(var).to eq false }
+ end
+ end
+ end
+
def actor(actor)
case actor
when Array