Update bust_tag to EdgeCache::BustTag (#11953)
This commit is contained in:
parent
e9886d106c
commit
d0c70e72d7
2 changed files with 5 additions and 5 deletions
|
|
@ -4,7 +4,7 @@ module Tags
|
|||
tag = Tag.find_by(name: tag_name)
|
||||
return unless tag
|
||||
|
||||
CacheBuster.bust_tag(tag)
|
||||
EdgeCache::BustTag.call(tag)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,26 +3,26 @@ require "rails_helper"
|
|||
RSpec.describe Tags::BustCacheWorker, type: :worker do
|
||||
let(:worker) { subject }
|
||||
|
||||
before { allow(CacheBuster).to receive(:bust_tag) }
|
||||
|
||||
# Passing in random tag
|
||||
include_examples "#enqueues_on_correct_queue", "high_priority", ["php"]
|
||||
|
||||
describe "#perform_now" do
|
||||
it "busts cache" do
|
||||
tag = create(:tag)
|
||||
allow(EdgeCache::BustTag).to receive(:call).with(tag)
|
||||
|
||||
worker.perform(tag.name)
|
||||
|
||||
expect(CacheBuster).to have_received(:bust_tag).with(tag)
|
||||
expect(EdgeCache::BustTag).to have_received(:call).with(tag)
|
||||
end
|
||||
|
||||
it "doesn't call the cache buster if the tag does not exist" do
|
||||
allow(EdgeCache::BustTag).to receive(:call)
|
||||
tag_name = "definitelyatagthatdoesnotexist"
|
||||
|
||||
worker.perform(tag_name)
|
||||
|
||||
expect(CacheBuster).not_to have_received(:bust_tag)
|
||||
expect(EdgeCache::BustTag).not_to have_received(:call)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue