cache_spec.rb 572 B

12345678910111213141516171819202122232425
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Cache do
  4. describe '.get' do
  5. before do
  6. allow(ActiveSupport::Deprecation).to receive(:warn)
  7. end
  8. it 'alias of Rails.cache.read' do
  9. allow(Rails.cache).to receive(:read)
  10. described_class.read('foo')
  11. expect(Rails.cache).to have_received(:read).with('foo')
  12. end
  13. it 'throws deprecation warning' do
  14. described_class.read('foo')
  15. expect(ActiveSupport::Deprecation).to have_received(:warn)
  16. end
  17. end
  18. end