* Create service for bust_organization * Create bust_podcast_episode_service * Add error spec to BustOrganization * Create bust_listings * Create bust_user service
34 lines
697 B
Ruby
34 lines
697 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe EdgeCache::BustUser, type: :service do
|
|
let(:user) { create(:user) }
|
|
|
|
let(:paths) do
|
|
username = user.username
|
|
|
|
[
|
|
"/#{username}",
|
|
"/#{username}?i=i",
|
|
"/#{username}/comments",
|
|
"/#{username}/comments?i=i",
|
|
"/#{username}/comments/?i=i",
|
|
"/live/#{username}",
|
|
"/live/#{username}?i=i",
|
|
"/feed/#{username}",
|
|
]
|
|
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(user)
|
|
|
|
paths.each do |path|
|
|
expect(described_class).to have_received(:bust).with(path).once
|
|
end
|
|
end
|
|
end
|