about summary refs log tree commit diff
path: root/spec/workers/cache_buster_worker_spec.rb
blob: adeb287fa3724697acfb5963ee6c3a029fa9e939 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

require 'rails_helper'

describe CacheBusterWorker do
  let(:worker) { described_class.new }

  describe 'perform' do
    let(:path) { 'https://example.com' }
    let(:service) { instance_double(CacheBuster, bust: true) }

    it 'calls the cache buster' do
      allow(CacheBuster).to receive(:new).and_return(service)
      worker.perform(path)

      expect(service).to have_received(:bust).with(path)
    end
  end
end