cache_buster_worker_spec.rb 460 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe CacheBusterWorker do
  4. let(:worker) { described_class.new }
  5. describe 'perform' do
  6. let(:path) { 'https://example.com' }
  7. let(:service) { instance_double(CacheBuster, bust: true) }
  8. it 'calls the cache buster' do
  9. allow(CacheBuster).to receive(:new).and_return(service)
  10. worker.perform(path)
  11. expect(service).to have_received(:bust).with(path)
  12. end
  13. end
  14. end