Sha256: cc978f27712d799979ae3da397b3bb4349ff48268d5728258c852fadf48b4c1e
Contents?: true
Size: 797 Bytes
Versions: 19
Compression:
Stored size: 797 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' RSpec.describe QaServer::CacheExpiryService do # rubocop:disable RSpec/MessageChain let(:timezone_name) { 'Eastern Time (US & Canada)' } before { allow(described_class).to receive_message_chain(:config, :preferred_time_zone_name).and_return(timezone_name) } describe '.cache_expiry' do before do allow(described_class).to receive_message_chain(:config, :hour_offset_to_expire_cache).and_return(3) allow(Time).to receive(:now).and_return(DateTime.parse('2019-12-11 02:54:59 -0500').in_time_zone(timezone_name)) end it 'returns seconds until offset time (simulates 1 second before offset time)' do expect(described_class.cache_expiry).to eq 1.second end end # rubocop:enable RSpec/MessageChain end
Version data entries
19 entries across 19 versions & 1 rubygems