Remove Tags::BustCacheJob and spec (#5897)

This commit is contained in:
Alex 2020-02-04 17:01:06 -08:00 committed by GitHub
parent e84dec1db6
commit aa7bc6b7b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 39 deletions

View file

@ -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

View file

@ -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