diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-10 15:07:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-10 15:07:47 +0300 |
commit | 96b0c1245c93585a8b0fe23e22306d32ff4e4905 (patch) | |
tree | d2904751e1a2529e8239381ce747339cdbf5116c /spec/lib/feature_spec.rb | |
parent | 0ba3a054d2190094ffda1ebe3aa53ffc5b92247d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/feature_spec.rb')
-rw-r--r-- | spec/lib/feature_spec.rb | 7 |
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 } |