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>2020-01-10 15:07:47 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-10 15:07:47 +0300
commit96b0c1245c93585a8b0fe23e22306d32ff4e4905 (patch)
treed2904751e1a2529e8239381ce747339cdbf5116c /spec/lib/feature_spec.rb
parent0ba3a054d2190094ffda1ebe3aa53ffc5b92247d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/feature_spec.rb')
-rw-r--r--spec/lib/feature_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/lib/feature_spec.rb b/spec/lib/feature_spec.rb
index 3d59b1f35a9..2525dd17b89 100644
--- a/spec/lib/feature_spec.rb
+++ b/spec/lib/feature_spec.rb
@@ -171,6 +171,13 @@ describe Feature do
end
end
+ it 'returns the default value when the database does not exist' do
+ fake_default = double('fake default')
+ expect(ActiveRecord::Base).to receive(:connection) { raise ActiveRecord::NoDatabaseError, "No database" }
+
+ expect(described_class.enabled?(:a_feature, default_enabled: fake_default)).to eq(fake_default)
+ end
+
context 'cached feature flag', :request_store do
let(:flag) { :some_feature_flag }