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/database_spec.rb | |
parent | d47fc5085a706ab37d038636c9d5934da69853f0 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/lib/gitlab/database_spec.rb')
-rw-r--r-- | spec/lib/gitlab/database_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/lib/gitlab/database_spec.rb b/spec/lib/gitlab/database_spec.rb index cd009f955af..47d2cb05240 100644 --- a/spec/lib/gitlab/database_spec.rb +++ b/spec/lib/gitlab/database_spec.rb @@ -129,6 +129,26 @@ RSpec.describe Gitlab::Database do end end + describe '.within_deprecation_notice_window?' do + using RSpec::Parameterized::TableSyntax + + where(:case_name, :days, :result) do + 'outside window' | Gitlab::Database::DEPRECATION_WINDOW_DAYS + 1 | false + 'equal to window' | Gitlab::Database::DEPRECATION_WINDOW_DAYS | true + 'within window' | Gitlab::Database::DEPRECATION_WINDOW_DAYS - 1 | true + end + + with_them do + it "returns #{params[:result]} when #{params[:case_name]}" do + allow(Date) + .to receive(:today) + .and_return Date.parse(Gitlab::Database::UPCOMING_POSTGRES_VERSION_DETAILS[:gl_version_date]) - days + + expect(described_class.within_deprecation_notice_window?).to eq(result) + end + end + end + describe '.check_postgres_version_and_print_warning' do subject { described_class.check_postgres_version_and_print_warning } |