2018-04-06 15:48:17 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Forever do
|
|
|
|
describe '.date' do
|
|
|
|
subject { described_class.date }
|
|
|
|
|
|
|
|
context 'when using PostgreSQL' do
|
2019-04-05 04:43:27 -04:00
|
|
|
it 'returns Postgresql future date' do
|
2018-04-06 15:48:17 -04:00
|
|
|
allow(Gitlab::Database).to receive(:postgresql?).and_return(true)
|
2018-09-07 11:08:55 -04:00
|
|
|
|
2018-04-06 15:48:17 -04:00
|
|
|
expect(subject).to eq(described_class::POSTGRESQL_DATE)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when using MySQL' do
|
2019-04-05 04:43:27 -04:00
|
|
|
it 'returns MySQL future date' do
|
2018-04-06 15:48:17 -04:00
|
|
|
allow(Gitlab::Database).to receive(:postgresql?).and_return(false)
|
2018-09-07 11:08:55 -04:00
|
|
|
|
2018-04-06 15:48:17 -04:00
|
|
|
expect(subject).to eq(described_class::MYSQL_DATE)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|