Remove Tags::BustCacheJob and spec (#5897)
This commit is contained in:
parent
e84dec1db6
commit
aa7bc6b7b2
2 changed files with 0 additions and 39 deletions
|
|
@ -1,12 +0,0 @@
|
|||
module Tags
|
||||
class BustCacheJob < ApplicationJob
|
||||
queue_as :tags_bust_cache
|
||||
|
||||
def perform(tag_name)
|
||||
tag = Tag.find_by(name: tag_name)
|
||||
return unless tag
|
||||
|
||||
CacheBuster.bust_tag(tag)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
require "rails_helper"
|
||||
|
||||
RSpec.describe Tags::BustCacheJob do
|
||||
before do
|
||||
allow(CacheBuster).to receive(:bust_tag)
|
||||
end
|
||||
|
||||
include_examples "#enqueues_job", "tags_bust_cache", "php"
|
||||
|
||||
describe "#perform_now" do
|
||||
it "busts cache" do
|
||||
tag = create(:tag)
|
||||
|
||||
described_class.perform_now(tag.name)
|
||||
|
||||
expect(CacheBuster).to have_received(:bust_tag).with(tag)
|
||||
end
|
||||
|
||||
it "doesn't call the cache buster if the tag does not exist" do
|
||||
tag_name = "definitelyatagthatdoesnotexist"
|
||||
|
||||
described_class.perform_now(tag_name)
|
||||
|
||||
expect(CacheBuster).not_to have_received(:bust_tag)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue