docbrown/spec/services/edge_cache/bust_commentable_spec.rb
Alex 393ba00221
Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606)
* Attempt number 1

* Fix rack_attack specs

* Fix users_searches_users spec

* Fix display_users_search_spec

* Fix comment typo

* Remove search:destroy task from cypress

* Remove port 9300 from gitpod

* Stub response in attack_spec
2021-05-03 11:09:45 -04:00

18 lines
606 B
Ruby

require "rails_helper"
RSpec.describe EdgeCache::BustCommentable, type: :service do
let(:cache_bust) { instance_double(EdgeCache::Bust) }
let(:commentable) { create(:article) }
before do
allow(EdgeCache::BustComment).to receive(:call)
allow(EdgeCache::Bust).to receive(:new).and_return(cache_bust)
allow(cache_bust).to receive(:call)
end
it "busts the cache" do
described_class.call(commentable)
expect(EdgeCache::BustComment).to have_received(:call).with(commentable).once
expect(cache_bust).to have_received(:call).with("#{commentable.path}/comments").once
end
end