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

Version Path
qa_server-8.0.1 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.9.2 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.9.1 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.9.0 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.8.0 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.7.1 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.7.0 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.6.0 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.5.1 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.5.0 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.4.0 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.3.0 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.2.1 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.2.0 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.1.3 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.1.2 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.1.1 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.1.0 spec/cache_processors/qa_server/cache_expiry_service_spec.rb
qa_server-7.0.0 spec/cache_processors/qa_server/cache_expiry_service_spec.rb