docbrown/spec/services/edge_cache/bust_page_spec.rb
Alex 8598ed090e
Create services for busting pages, tags, events, and podcasts (#11812)
* Create bust_page service and spec

* Specify spec with .once

* Create bust_tag service and spec

* Create bust_event service and spec

* Create bust_podcast service and spec
2020-12-09 10:37:02 -05:00

27 lines
514 B
Ruby

require "rails_helper"
RSpec.describe EdgeCache::BustPage, type: :service do
let(:slug) { "slug" }
let(:paths) do
[
"/page/#{slug}",
"/page/#{slug}?i=i",
"/#{slug}",
"/#{slug}?i=i",
]
end
before do
paths.each do |path|
allow(described_class).to receive(:bust).with(path).once
end
end
it "busts the cache" do
described_class.call(slug)
paths.each do |path|
expect(described_class).to have_received(:bust).with(path).once
end
end
end