diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-23 21:27:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-23 21:27:09 +0300 |
commit | bcc70301531b6c3118120173389f2aaa7452bf11 (patch) | |
tree | 161f1ee56e15ec9e59f48c5e1a9cb86b62469a49 /spec/lib/gitlab/config_checker | |
parent | d47fc5085a706ab37d038636c9d5934da69853f0 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/lib/gitlab/config_checker')
-rw-r--r-- | spec/lib/gitlab/config_checker/external_database_checker_spec.rb | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/spec/lib/gitlab/config_checker/external_database_checker_spec.rb b/spec/lib/gitlab/config_checker/external_database_checker_spec.rb index 316696bc584..712903e020a 100644 --- a/spec/lib/gitlab/config_checker/external_database_checker_spec.rb +++ b/spec/lib/gitlab/config_checker/external_database_checker_spec.rb @@ -36,9 +36,23 @@ RSpec.describe Gitlab::ConfigChecker::ExternalDatabaseChecker do allow(Gitlab::Database).to receive(:postgresql_upcoming_deprecation?).and_return(true) end - it 'only returns notice about an upcoming deprecation' do - is_expected.to include(a_hash_including(message: include(upcoming_deprecation_warning))) - is_expected.not_to include(a_hash_including(message: include(deprecation_warning))) + context 'inside the deprecation notice window' do + before do + allow(Gitlab::Database).to receive(:within_deprecation_notice_window?).and_return(true) + end + + it 'only returns notice about an upcoming deprecation' do + is_expected.to include(a_hash_including(message: include(upcoming_deprecation_warning))) + is_expected.not_to include(a_hash_including(message: include(deprecation_warning))) + end + end + + context 'outside the deprecation notice window' do + before do + allow(Gitlab::Database).to receive(:within_deprecation_notice_window?).and_return(false) + end + + it { is_expected.to be_empty } end end @@ -48,11 +62,28 @@ RSpec.describe Gitlab::ConfigChecker::ExternalDatabaseChecker do allow(Gitlab::Database).to receive(:postgresql_upcoming_deprecation?).and_return(true) end - it 'returns notice about deprecated database version and an upcoming deprecation' do - is_expected.to include( - a_hash_including(message: include(deprecation_warning)), - a_hash_including(message: include(upcoming_deprecation_warning)) - ) + context 'inside the deprecation notice window' do + before do + allow(Gitlab::Database).to receive(:within_deprecation_notice_window?).and_return(true) + end + + it 'returns notice about deprecated database version and an upcoming deprecation' do + is_expected.to include( + a_hash_including(message: include(deprecation_warning)), + a_hash_including(message: include(upcoming_deprecation_warning)) + ) + end + end + + context 'outside the deprecation notice window' do + before do + allow(Gitlab::Database).to receive(:within_deprecation_notice_window?).and_return(false) + end + + it 'only returns notice about deprecated database version' do + is_expected.to include(a_hash_including(message: include(deprecation_warning))) + is_expected.not_to include(a_hash_including(message: include(upcoming_deprecation_warning))) + end end end end |