* 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
18 lines
606 B
Ruby
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
|